Would it be useful for beginners to a see an example of map and forEach in the cheatsheet if your are a beginner coming from JavaScript?
How did you find out the syntax for that?
JavaScript | Reason |
---|---|
[1,2,3].forEach(i => { console.log(i) }) |
Array.iter(i => { Js.log(i) }, [|1,2,3|]) |
[1,2,3].map(i => { return i + 1 }) |
Array.map(i => i + 1, [|1,2,3|]) |