2 ms·
"myFunction(item) for item in array" is a list comprehension a lot of languages have ... among them python and haskell. It's really nothing special. Hell, it's
by Swizec 15y ago
"myFunction(item) for item in array" is a list comprehension a lot of languages have ... among them python and haskell. It's really nothing special.
Hell, it's very similar to how "map" works in most functional languages -> "map function items"
- SideburnsOfDoom 15y agoI can see how map works. It could even be done in JavaScript: map(myFunction, items); "myFunction(item) for item in array" looks like "call myFunction on "item", which is not yet defined... oh now it is." It's backwards.