replace 'prompt' example by 'environment'
This commit is contained in:
parent
f8008aa25d
commit
b1c2e7836d
15 changed files with 317 additions and 517 deletions
|
|
@ -7,7 +7,7 @@ export const push = ls => elem => ls.concat([elem]);
|
|||
export const pop = ls => ls.pop();
|
||||
export const map = ls => fn => ls.map(elem => fn(elem));
|
||||
export const length = ls => ls.length;
|
||||
export const fold = ls => callback => initial => {
|
||||
export const fold = callback => initial => ls => {
|
||||
let acc = initial;
|
||||
for (let i=0; i<ls.length; i++) {
|
||||
acc = callback(acc)(ls[i]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue