Serenity Operating System
at hosted 16 lines 426 B view raw
1try { 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 13 console.log("PASS"); 14} catch (e) { 15 console.log("FAIL: " + e); 16}