Python allows you to create multiple generators:
>>> [(x,y,x*y) for x in range(1,5) for y in range(1,5)] [(1, 1, 1), (1, 2, 2), (1, 3, 3), (1, 4, 4), (2, 1, 2), (2, 2, 4), (2, 3, 6), (2, 4, 8), (3, 1, 3), (3, 2, 6), (3, 3, 9), (3, 4, 12), (4, 1, 4), (4, 2, 8), (4, 3, 12), (4, 4, 16)]
And also limitations:
>>> [(x,y,x*y) for x in range(1,5) for y in range(1,5) if x*y > 8] [(3, 3, 9), (3, 4, 12), (4, 3, 12), (4, 4, 16)]
Update : Javascript syntax is similar (result of using javascript shell in firefox):
var nums = [1, 2, 3, 21, 22, 30]; var s = eval('[[i,j] for each (i in nums) for each (j in [3,4]) if (i%2 == 0)]'); s.toSource(); [[2, 3], [2, 4], [22, 3], [22, 4], [30, 3], [30, 4]]
(For some reason, something about context material is evaluated in a javascript shell, which requires the eval pointer to have list functions. Javascript inside the <script> does not require this, of course)