I\'m just starting to research different programming styles (OOP, functional, procedural).
I\'m learning JavaScript and starting into underscore.js and came along this s
Functional: You pass an object to the function and do stuff
_.map([1, 2, 3], function(n){ return n * 2; });
OOP: You call function on the object and do stuff
_([1, 2, 3]).map(function(n){ return n * 2; });
In both examples [1,2,3] (array)
is an object.
Example OOP reference: http://underscorejs.org/#times