Math.cos.js 426 B

12345678910111213141516
  1. try {
  2. assert(Math.cos(0) === 1);
  3. assert(Math.cos(null) === 1);
  4. assert(Math.cos('') === 1);
  5. assert(Math.cos([]) === 1);
  6. assert(Math.cos(Math.PI) === -1);
  7. assert(isNaN(Math.cos()));
  8. assert(isNaN(Math.cos(undefined)));
  9. assert(isNaN(Math.cos([1, 2, 3])));
  10. assert(isNaN(Math.cos({})));
  11. assert(isNaN(Math.cos("foo")));
  12. console.log("PASS");
  13. } catch (e) {
  14. console.log("FAIL: " + e);
  15. }