为什么枚举是原版 javascript 中的保留关键字?

Why enum is a reserved keyword in vanilla javascript?

我试图声明一个名为 enum 的变量,但出现 Uncaught SyntaxError: Unexpected reserved word 错误。

我没有使用打字稿,为什么 enum 是保留关键字?

我是searching for it,发现enum是保留关键字,但是protected也是保留关键字,没有给我报错

我也找不到 enum 的用途或它在 vanilla js 中的工作方式。

根据 docs

The following are reserved as future keywords by the ECMAScript specification. They have no special functionality at present, but they might at some future time, so they cannot be used as identifiers.

并且 enum 始终是保留关键字。