[x] Runners for the code in lib: bin/reduce.js, bin/map.js, etc.
[ ] Corresponding tests
[x] Example data: lib/example-arrays.js (better name or place?)
Others?
For the example data, at least these:
'use strict';
const whole = new Array(11).fill(1).map((e, i, a) => e * i);
const even = new Array(11).fill(2).map((e, i, a) => e * i);
const odd = new Array(11).fill(2).map((e, i, a) => (e * i) + 1);
const fibonacci = ((f0, f1, count) => {
let fibs = [f0, f1];
for (let i = 2; i < count; i++) {
fibs[i] = fibs[i-1] + fibs[i-2];
}
return fibs;
})(0, 1, 11);
module.exports = {
even,
odd,
fibs,
};
At least these:
lib
:bin/reduce.js
,bin/map.js
, etc.lib/example-arrays.js
(better name or place?)Others?
For the example data, at least these:
And that can be required by the code runners.
Some none numeric examples would be good, too.