While exploring the code in Underscore
: http://underscorejs.org/docs/underscore.html
I stumbled upon
var _ = function(obj) {
if (obj instanceof _) return obj;
if (!(this instanceof _)) return new _(obj);
this._wrapped = obj;
};
accompanied by this comment
Create a safe reference to the Underscore object for use below.
I am unsure of its purpose. Instead, why not simplify it to
(function() {
var _ = {};
_.VERSION = '1.7.0';
})();
What is the rationale behind the technique employed by the Underscore
project?