Skip to content

Commit

Permalink
Simplify the arrayMerge example to involve less distracting assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
TehShrike committed Oct 9, 2017
1 parent 494d019 commit d87eb96
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,13 @@ However, there are nigh-infinite valid ways to merge arrays, and you may want to

```js
function overwriteMerge(destinationArray, sourceArray, options) {
destinationArray // => [1, 2, 3]
sourceArray // => [3, 2, 1]
options // => { arrayMerge: overwriteMerge }
return sourceArray
}
merge([1, 2, 3], [3, 2, 1], { arrayMerge: overwriteMerge }) // => [3, 2, 1]
merge(
[1, 2, 3],
[3, 2, 1],
{ arrayMerge: overwriteMerge }
) // => [3, 2, 1]
```

To prevent arrays from being merged:
Expand Down

0 comments on commit d87eb96

Please sign in to comment.