Serenity Operating System
at hosted 17 lines 475 B view raw
1try { 2 assert(Math.sin(0) === 0); 3 assert(Math.sin(null) === 0); 4 assert(Math.sin('') === 0); 5 assert(Math.sin([]) === 0); 6 assert(Math.sin(Math.PI * 3 / 2) === -1); 7 assert(Math.sin(Math.PI / 2) === 1); 8 assert(isNaN(Math.sin())); 9 assert(isNaN(Math.sin(undefined))); 10 assert(isNaN(Math.sin([1, 2, 3]))); 11 assert(isNaN(Math.sin({}))); 12 assert(isNaN(Math.sin("foo"))); 13 14 console.log("PASS"); 15} catch (e) { 16 console.log("FAIL: " + e); 17}