Merge pull request #3385 from RichardLitt/patch-2

Nominalized 'shallow copy'
This commit is contained in:
Ben Alpert
2015-03-11 16:27:26 -07:00
+1 -1
View File
@@ -39,7 +39,7 @@ var newData = extend(myData, {
});
```
While this is fairly performant (since it only shallow copies `log n` objects and reuses the rest), it's a big pain to write. Look at all the repetition! This is not only annoying, but also provides a large surface area for bugs.
While this is fairly performant (since it only makes a shallow copy of `log n` objects and reuses the rest), it's a big pain to write. Look at all the repetition! This is not only annoying, but also provides a large surface area for bugs.
`update()` provides simple syntactic sugar around this pattern to make writing this code easier. This code becomes: