I want to give a link to variables in javascript.
For example, I want:
a=1 b=a a=2
and have b = 2 and change accordingly to a.
Is this possible in javascript? If not, is there a way to do it like a.onchange = function () {b = a}?
What I wanted to do was makeobject function, which creates an object and puts it in an array, and returns it as
function makeobject() { objects[objects.length] = {blah:'whatever',foo:8}; }
so i can do
a=makeobject() b=makeobject() c=makeobject()
and then in the do code
for (i in objects) { objects[i].blah = 'whatev'; }
as well as change the values ββof a, b and c
source share