say I've got a variable which points to that memory, can I actually change the memory to completely new memory so that every other variable pointing to that memory now points to new memory?
var foo = function(obj){
// I want to set obj to new memory
obj = { bar: 'foo' }
}
var boo = function(obj){
// can change properties to new memory
obj.too = { hoo: 'doo' }
}
var zoo = { too: { woo: 'loo' } }
// no change of memory
console.log(zoo)
foo(zoo)
console.log(zoo)
// change of memory
console.log(zoo)
boo(zoo)
console.log(zoo)