Math.max.js 345 B

123456789101112131415
  1. load("test-common.js");
  2. try {
  3. assert(Math.max.length === 2);
  4. assert(Math.max() === -Infinity);
  5. assert(Math.max(1) === 1);
  6. assert(Math.max(2, 1) === 2);
  7. assert(Math.max(1, 2, 3) === 3);
  8. assert(isNaN(Math.max(NaN)));
  9. assert(isNaN(Math.max("String", 1)));
  10. console.log("PASS");
  11. } catch {
  12. console.log("FAIL");
  13. }