Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,3 @@
var foo = function() { return arguments.length };
foo() // 0
foo(1, 2, 3) // 3

View file

@ -0,0 +1 @@
var squares = [1, 2, 3].map(function (n) { return n * n }); // [1, 4, 9]

View file

@ -0,0 +1,5 @@
var make_adder = function(m) {
return function(n) { return m + n }
};
var add42 = make_adder(42);
add42(10) // 52

View file

@ -0,0 +1,4 @@
foo.toString()
"function () { return arguments.length }"
alert.toString()
"function alert() { [native code] }"

View file

@ -0,0 +1,6 @@
var mutate = function(victim) {
victim[0] = null;
victim = 42;
};
var foo = [1, 2, 3];
mutate(foo) // foo is now [null, 2, 3], not 42