Getting All Variables In Scope

前端 未结 10 2325
小蘑菇
小蘑菇 2020-11-22 09:10

Is there a way to get all variables that are currently in scope in javascript?

10条回答
  •  借酒劲吻你
    2020-11-22 09:54

    You can't.

    Variables, identifiers of function declarations and arguments for function code, are bound as properties of the Variable Object, which is not accesible.

    See also:

    • Scope Chain and Identifier Resolution

提交回复
热议问题