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

后端 未结 3 962
南方客
南方客 2020-11-28 09:09

Is it possible to find the memory address of a JavaScript variable? The JavaScript code is part of (embedded into) a normal application where JavaScript is used as a front

3条回答
  •  渐次进展
    2020-11-28 09:26

    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?

提交回复
热议问题