List comprehensions: Difference between revisions

Content deleted Content added
Hout (talk | contribs)
Hout (talk | contribs)
Line 798:
 
 
In JavaScript 1.6 onwards (while we wait for array comprehension syntax in JavaScript 1.7) we can emulate the parts of a list comprehension expression by applying '''Array.prototype.filter''' to a functionally defined set, returning a list of matches.
 
Following the pattern of the [[#Mathematica|Mathematica]] example, and using functional set definitions, rather than for loops: