Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var obj = {
- a: {
- foo: 1,
- bar: 2
- },
- b: {
- quux: 3
- },
- c: 4
- };
- obj.{
- // nested update
- a.{
- baz: 5
- },
- // replace
- b: {
- mumble: 6
- }
- d: 5,
- };
- obj.a.foo === 1 &&
- obj.a.bar === 2 &&
- obj.a.baz === 5 &&
- !("quux" in obj.b) &&
- obj.b.mumble === 6
Add Comment
Please, Sign In to add comment