Skip to content
Advertisement

Translating Python loop to Javascript [closed]

How can I yield the same output in Javascript, given this Python example?

I want to loop over an array and check a value, if condition met, store it.

JavaScript

Advertisement

Answer

This can be done more simply with Array#filter.

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement