JavaScript 表达式


【JavaScript expressions】

默认的求值器支持 JavaScript 表达式的直接求值:

【The default evaluator supports direct evaluation of JavaScript expressions:】

> 1 + 1
2
> const m = 2
undefined
> m + 1
3 

除非在块或函数中另有规定,否则使用 constletvar 关键字声明的变量,或者隐式声明的变量,都是在全局作用域中声明的。

【Unless otherwise scoped within blocks or functions, variables declared either implicitly or using the const, let, or var keywords are declared at the global scope.】