- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
// 600+ lines skipped
int main() {
window["console"] = console;
window["Math"] = Math;
Math["sin"] = Math.sin;
Math["cos"] = Math.cos;
Math["PI"] = Math.PI;
// EXAMPLE:
var x = 3;
var y = x + null;
var z = "hello, " + y;
var n = NaN << NaN;
var f = Function();
console.log("x = " + x + " y = " + y + " z = " + z);
console.log("x =", x,"y =", y, "z =", z);
console.log(String("222") + true);
console.log(String("222") + 3);
console.log(Number("222") + 3);
console.log(NaN << NaN, !NaN);
console.log(undefined + 1);
console.log(f("hello, ", "world"));
console.log("sin(pi/4) = ", Math.sin(Math["PI"] / 4));
console.log("sin(pi/4) = ", window["Math"]["sin"](Math["PI"] / 4));
}