What Is The Underscore Function For?
I've been using underscore as a collection of statics. What is the underscore function for: var _ = function(obj) { if (obj instanceof _) return obj; if (!(this instanceof
Solution 1:
You also can use Underscore as a wrapper function, to get a more OOP-like style:
_(val).method(…);
// instead of the equal
_.method(val, …);
These wrapper objects also allow chaining:
_.chain(val).method1(…).method2(…);
// or_(val).chain().method1(…).method2(…);
Post a Comment for "What Is The Underscore Function For?"