Skip to content

Commit ad2f92a

Browse files
committed
docs(readme): Add a note about precedence
Closes #115.
1 parent c3a5156 commit ad2f92a

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ var output = merge(object1, object2, object3, ...);
2121
// You can pass an array of objects directly.
2222
// This works with all available functions.
2323
var output = merge([object1, object2, object3]);
24+
25+
// Please note that where keys match,
26+
// the objects to the right take precedence:
27+
var output = merge(
28+
{ fruit: "apple", color: "red" },
29+
{ fruit: "strawberries" }
30+
);
31+
console.log(output);
32+
// { color: "red", fruit: "strawberries"}
2433
```
2534

2635
### **`merge({ customizeArray, customizeObject })(...configuration | [...configuration])`**

0 commit comments

Comments
 (0)