rtfeldman / seamless-immutable

Immutable data structures for JavaScript which are backwards-compatible with normal JS Arrays and Objects.
BSD 3-Clause "New" or "Revised" License
5.36k stars 194 forks source link

Add an example to show map vs flatMap #259

Closed element6 closed 5 years ago

element6 commented 5 years ago

This might help people like me who wants to see a code example :)

coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 96.111% when pulling 101551ac76632eb4dee5f654a723385a779d2b92 on element6:master into b196e2d47754fa3f5e7efaeb7f47399e9e76ce88 on rtfeldman:master.

crudh commented 5 years ago

@element6 looks like a good addition! Maybe you could tweak it a bit to look like to other examples so it blends in? Like showing the results in comments and renaming the array a to array and the value a to value? It could be confusing that two different things are named a.

element6 commented 5 years ago

Good idea! I guess it also makes it easier for people to copy and paste into their console to test.

crudh commented 5 years ago

@element6 thanks!