mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 17:37:50 +00:00
Ensure _.add and _.subtract return 0 when no arguments are given.
This commit is contained in:
@@ -13862,6 +13862,9 @@
|
||||
*/
|
||||
function add(augend, addend) {
|
||||
var result;
|
||||
if (augend === undefined && addend === undefined) {
|
||||
return 0;
|
||||
}
|
||||
if (augend !== undefined) {
|
||||
result = augend;
|
||||
}
|
||||
@@ -14072,6 +14075,9 @@
|
||||
*/
|
||||
function subtract(minuend, subtrahend) {
|
||||
var result;
|
||||
if (minuend === undefined && subtrahend === undefined) {
|
||||
return 0;
|
||||
}
|
||||
if (minuend !== undefined) {
|
||||
result = minuend;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user