mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 18:07:49 +00:00
Add _.rangeRight tests.
This commit is contained in:
12
lodash.js
12
lodash.js
@@ -3273,13 +3273,9 @@
|
||||
length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
|
||||
result = Array(length);
|
||||
|
||||
while (++index < length) {
|
||||
if (fromRight) {
|
||||
result[index] = (end -= step);
|
||||
} else {
|
||||
result[index] = start;
|
||||
start += step;
|
||||
}
|
||||
while (length--) {
|
||||
result[fromRight ? length : ++index] = start;
|
||||
start += step;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -13348,7 +13344,7 @@
|
||||
* // => [-3, -2, -1, 0]
|
||||
*
|
||||
* _.rangeRight(1, 4, 0);
|
||||
* // => [4, 4, 4]
|
||||
* // => [1, 1, 1]
|
||||
*
|
||||
* _.rangeRight(0);
|
||||
* // => []
|
||||
|
||||
Reference in New Issue
Block a user