How can I get the memory address of a JavaScript variable?

If it would be possible at all, it would be very dependent on the javascript engine. The more modern javascript engine compile their code using a just in time compiler and messing with their internal variables would be either bad for performance, or bad for stability.

If the engine allows it, why not make a function call interface to some native code to exchange the variable’s values?

Leave a Comment