Is there anything similar to pythons list comprehension for nodejs/javascript? If there is not then is it possible to make a function that has similar behavior for example
# Example 1
list_one = [[1, 2], [3, 4], [5, 6], [7, 8]]
someOfList = sum(x[1] for x in list_one)
print(someOfList) # prints 20
# Example 2
combined = "".join([str( ( int(x) + int(y) ) % 10) for x, y in zip("9999", "3333")])
print(combined) # prints 2222
Etc? Or would you have to make functions for each comprehension like behavior? I know you can make functions for each of those, but if you use a lot of list comprehensions code can get long