mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 10:57:49 +00:00
Clarify a bit more the order is not guaranteed notes on object iteration.
Former-commit-id: bfe3033325bc941a03948fe41056634663a10989
This commit is contained in:
20
dist/lodash.compat.js
vendored
20
dist/lodash.compat.js
vendored
@@ -1706,7 +1706,7 @@
|
||||
* @example
|
||||
*
|
||||
* _.keys({ 'one': 1, 'two': 2, 'three': 3 });
|
||||
* // => ['one', 'two', 'three'] (order is not guaranteed)
|
||||
* // => ['one', 'two', 'three'] (property order is not guaranteed across environments)
|
||||
*/
|
||||
var keys = !nativeKeys ? shimKeys : function(object) {
|
||||
if (!isObject(object)) {
|
||||
@@ -1969,7 +1969,7 @@
|
||||
* _.findKey({ 'a': 1, 'b': 2, 'c': 3, 'd': 4 }, function(num) {
|
||||
* return num % 2 == 0;
|
||||
* });
|
||||
* // => 'b' (order is not guaranteed)
|
||||
* // => 'b' (property order is not guaranteed across environments)
|
||||
*/
|
||||
function findKey(object, callback, thisArg) {
|
||||
var result;
|
||||
@@ -2042,7 +2042,7 @@
|
||||
* _.forIn(new Dog('Dagny'), function(value, key) {
|
||||
* console.log(key);
|
||||
* });
|
||||
* // => logs 'bark' and 'name' (order is not guaranteed)
|
||||
* // => logs 'bark' and 'name' (property order is not guaranteed across environments)
|
||||
*/
|
||||
var forIn = createIterator(eachIteratorOptions, forOwnIteratorOptions, {
|
||||
'useHas': false
|
||||
@@ -2110,7 +2110,7 @@
|
||||
* _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) {
|
||||
* console.log(key);
|
||||
* });
|
||||
* // => logs '0', '1', and 'length' (order is not guaranteed)
|
||||
* // => logs '0', '1', and 'length' (property order is not guaranteed across environments)
|
||||
*/
|
||||
var forOwn = createIterator(eachIteratorOptions, forOwnIteratorOptions);
|
||||
|
||||
@@ -2729,7 +2729,7 @@
|
||||
* @example
|
||||
*
|
||||
* _.pairs({ 'moe': 30, 'larry': 40 });
|
||||
* // => [['moe', 30], ['larry', 40]] (order is not guaranteed)
|
||||
* // => [['moe', 30], ['larry', 40]] (property order is not guaranteed across environments)
|
||||
*/
|
||||
function pairs(object) {
|
||||
var index = -1,
|
||||
@@ -2857,7 +2857,7 @@
|
||||
* @example
|
||||
*
|
||||
* _.values({ 'one': 1, 'two': 2, 'three': 3 });
|
||||
* // => [1, 2, 3] (order is not guaranteed)
|
||||
* // => [1, 2, 3] (property order is not guaranteed across environments)
|
||||
*/
|
||||
function values(object) {
|
||||
var index = -1,
|
||||
@@ -3242,7 +3242,7 @@
|
||||
* // => logs each number and returns '1,2,3'
|
||||
*
|
||||
* _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { console.log(num); });
|
||||
* // => logs each number value and returns the object (order is not guaranteed)
|
||||
* // => logs each number and returns the object (property order is not guaranteed across environments)
|
||||
*/
|
||||
function forEach(collection, callback, thisArg) {
|
||||
if (callback && typeof thisArg == 'undefined' && isArray(collection)) {
|
||||
@@ -3440,7 +3440,7 @@
|
||||
* // => [3, 6, 9]
|
||||
*
|
||||
* _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { return num * 3; });
|
||||
* // => [3, 6, 9] (order is not guaranteed)
|
||||
* // => [3, 6, 9] (property order is not guaranteed across environments)
|
||||
*
|
||||
* var stooges = [
|
||||
* { 'name': 'moe', 'age': 40 },
|
||||
@@ -5320,9 +5320,7 @@
|
||||
var isCalled = trailing && (!leading || callCount > 1);
|
||||
clear();
|
||||
if (isCalled) {
|
||||
if (maxWait !== false) {
|
||||
lastCalled = +new Date;
|
||||
}
|
||||
lastCalled = +new Date;
|
||||
result = func.apply(thisArg, args);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user