8000 chore: combine the if statements into one (#5785) · lodash/lodash@6a2cc1d · GitHub
[go: up one dir, main page]

Skip to content

Commit 6a2cc1d

Browse files
authored
chore: combine the if statements into one (#5785)
1 parent a67a085 commit 6a2cc1d

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/.internal/createMathOperation.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,8 @@ function createMathOperation(operator, defaultValue) {
1414
if (value === undefined && other === undefined) {
1515
return defaultValue
1616
}
17-
if (value !== undefined && other === undefined) {
18-
return value
19-
}
20-
if (other !== undefined && value === undefined) {
21-
return other
17+
if(value === undefined || other === undefined) {
18+
return value || other
2219
}
2320
if (typeof value === 'string' || typeof other === 'string') {
2421
value = baseToString(value)

0 commit comments

Comments
 (0)
0