Python has lovely list comprehension, out of boredom I made a very horrid version of something like comprehension for JavaScript, its totally useless other then for trivial cases.
First clone down the repo:
$ git clone https://github.com/coding-ninja/comprehension.js
$ cd comprehension.js/Next up we just need to install all the JavaScript dependencies:
$ npm installNow we can run the mocha and chai tests:
$ npm run test
Basic Python Like Comprehension Tests
✓ should should return the whole array
✓ should should return the double each element
✓ should should return greater then 1 but also skip out 3
3 passing (8ms)