[whatever]:[number] 构造在开发人员控制台中意味着什么?

What does the [whatever]:[number] construct mean in the developer console?

我在浏览器中使用开发者控制台时,不小心输入了类似whatewer:42的构造 控制台作为响应在冒号后输出一个数字。我不明白为什么需要这样的结构。如果你在其他地方使用它,你会得到一个错误。

If you use it anywhere else, you get an error.

不,你不知道。这是一个 labeled statement.

function test() {
  whatever: 42;
  console.log('No error');
}

test();