Math.max.js 323 B

1234567891011121314
  1. function assert(x) { if (!x) throw 1; }
  2. try {
  3. assert(Math.max.length === 2);
  4. assert(Math.max(1) === 1);
  5. assert(Math.max(2, 1) === 2);
  6. assert(Math.max(1, 2, 3) === 3);
  7. assert(isNaN(Math.max(NaN)));
  8. assert(isNaN(Math.max("String", 1)));
  9. console.log("PASS");
  10. } catch {
  11. console.log("FAIL");
  12. }