Skip to content

Commit 2a4b7d2

Browse files
authored
honor b
1 parent 294b1a8 commit 2a4b7d2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎merge objects‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
function mergeObjects(a, b) {
2-
if(a === null || typeof a !== 'object') return b ?? {};
3-
if(b === null || typeof b !== 'object') return b ?? {};
2+
if(a === null || typeof a !== 'object') return b;
3+
if(b === null || typeof b !== 'object') return b;
44

55
const obj = Array.isArray(a) ? [...a] : a;
66

0 commit comments

Comments
 (0)