4 ms·
This doesn't make the target object read-only - it just returns a reference to it. data = {one: "one"} ref = makeRef(data) ref().two = "two" data
by effbott 13y ago
This doesn't make the target object read-only - it just returns a reference to it.
data = {one: "one"}
ref = makeRef(data)
ref().two = "two"
data
=> Object {one: "one", two: "two"}