Access all local variables

前端 未结 2 1037
别跟我提以往
别跟我提以往 2020-12-06 05:26

Every global variable in javascript is a property of \'window\'

Apparently all local variable (aswell as arguments) are stored as properties of the \'Call object\' (

2条回答
  •  感情败类
    2020-12-06 06:03

    No. There is no way of doing this in any browser implementation of JavaScript.

    It's theoretically possible that an implementation could provide an extension to allow code to inspect the current Variable object (aka the Activation object within a function; "Call object" is a term made up by Flanagan that is not mentioned anywhere within the ECMAScript spec) but no implementation I know of does this.

提交回复
热议问题