Have you used the popular library Underscore.js http://underscorejs.org/? The equivalent to your code in Underscore would be:
_.chain([1,2,3]).map(n => n * n).filter(n => n >= 2).value()