Clone and edit this document
Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
immutability-helper test
node v10.24.1
version:
1.0.0
endpoint
share
tweet
const update = require("immutability-helper") let obj1 = {a:[1]}; let obj2 = {a:[1]}; obj1.a === obj2.a
const newArr = [3]; const obj1e1 = update(obj1, {c: {$set: newArr}}) obj1.a === obj1e1.a
obj1 === obj1e1
newArr.push(2); let obj3 = {c:newArr}; obj3.c === obj1e1.c
Loading…
no comments
sign in
to comment