// Collection Functions // -------------------- // The cornerstone, an `each` implementation, aka `forEach`. // Handles raw objects in addition to array-likes. Treats all // sparse array-likes as if they were dense. /* params: 数组.对象或类数组对象,函数,函数执行环境 *…
(function() { // Baseline setup // -------------- // Establish the root object, `window` (`self`) in the browser, `global` // on the server, or `this` in some virtual machines. We use `self` // instead of `window` for `WebWorker` support. /* 判断root是w…
// Object Functions // ---------------- // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed. /* ie9以下版本中,对象中的key是不能被遍历的 */ var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString'); var nonEnumerableProps = ['valueO…
// Function (ahem) Functions // ------------------ // Determines whether to execute a function as a constructor // or a normal function with the provided arguments. /* 判断一个函数是按照构造函数还是普通函数执行?????????????????????????????????????????????????????????? */…
// Array Functions // --------------- // Get the first element of an array. Passing **n** will return the first N // values in the array. Aliased as `head` and `take`. The **guard** check // allows it to work with `_.map`. /* 返回array(数组)的第一个元素.传递 n参数…