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,7 @@
var i, j;
for (i = 1; i <= 5; i += 1) {
s = '';
for (j = 0; j < i; j += 1)
s += '*';
document.write(s + '<br>');
}

View file

@ -0,0 +1,5 @@
function range(i) {
return i ? range(i - 1).concat(i) : [];
}
range(5) --> [1, 2, 3, 4, 5]

View file

@ -0,0 +1,12 @@
var s = '';
range(5).forEach(
function (line) {
range(line).forEach(
function () { s += '*'; }
);
s += '\n';
}
);
console.log(s);

View file

@ -0,0 +1,7 @@
console.log(
range(5).reduce(
function (a, n) {
return a + Array(n + 1).join('*') + '\n';
}, ''
)
);

View file

@ -0,0 +1,5 @@
console.log(
range(5).map(function(a) {
return Array(a + 1).join('*');
}).join('\n')
);