copy with that value??
usecase:
using vuejs.
want to ref the status of a window to a data property, so that i can attach a watcher to watch for changes in that variable,
i think you need to make it mutable, more or less like this
Objects (including arrays and functions) are always passed by reference const obj = { a: 42 }; function something(param) { param.a = 100; } something(obj); console.log(obj.a); // 100 Primitives are always passed by value const prim = 42; function something(param) { param = 100; } something(prim); console.log(prim); // 42
this is not what i was talking abt.
but im handling primitves
primitives cant be passed by ref as far as i know
Обсуждают сегодня