Using underscore.js with node.js
Underscore.js:
UnderscoreΒ is a JavaScript library that provides a whole mess of useful functional programming helpers without extending any built-in objects. Itβs the answer to the question: βIf I sit down in front of a blank HTML page, and want to start being productive immediately, what do I need?β β¦ and the tie to go along withΒ jQueryβs tux andBackboneβs suspenders.
Underscore provides over 100 functions that support both your favorite workaday functional helpers:Β map,Β filter,Β invokeΒ β as well as more specialized goodies: function binding, javascript templating, creating quick indexes, deep equality testing, and so on.
Source:Β http://underscorejs.org/
To install underscore.js in a node.js project use: npm install underscore
After installing it you can use underscore now on your node.js project as :Β var _ = require(βunderscoreβ);
Things you can do with _Β :
1. Merge two json objects:
var obj1 = {foo:βbarβ};
var obj2 = {name:βjohnβ};
var merged = _.extend(obj1,obj2);










