Finally, I was curious to know why javascript does its voodoo magic to find out why not all object references are created equal.
For example:
var a, b, c, d; a = 100; b = a; c = {}; d = c; b = 10; de = 'f'; console.log(a, b); // outputs 100, 10 console.log(c, d); // outputs object => e = 'f', object => e = 'f'
If all the variables in javascript are objects, then what makes the use case with c and d explicitly expressed as Object , how does a and b differ as Number ? Or, why are c and d related to each other and not a and b ?
source share