These days have great God recommended to read underscore source code, take advantage of the project test blank time, looked at a bit.
The whole underscore includes the common tool functions, the following 1.3.3 source code for example analysis.
function (obj) { return _.isarray (obj)? obj.length: _.keys (obj). length; };
The whole underscore source code is basically the above way to write, so understand the above source code, the entire underscore source is probably clear six or seven, the remaining source code with some time, it will be solved.
Because there is _.keys in the above function, it may not be clear at once, the following function source code easier to get started.
function (obj) { return obj!== obj; };
Just figure out what the object _ and the function parameter obj are doing.
var function (obj) { returnnew wrapper (obj); };
_ is defined as a function that takes a formal parameter named obj, and then returns an instance of the wrapper class.
Underscore source reading record