为什么 ECMAScript 规范中没有定义一些 javaScript 结构的语法
例如,ECMAScript中 if 语句的语法定义如下
13.6 The if Statement
Syntax
IfStatement[Yield, Await, Return]:
if ( Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return] else
Statement[?Yield, ?Await, ?Return]
if( Expression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return]
Each else for which the choice of associated if is ambiguous shall be associated with the nearest
possible if that would otherwise have no corresponding else.
我需要知道为什么在某些结构中,如for-statement
,do-while statement
和while-statement
ECMAScript 没有定义语法