@@(“at at")在 ES6 JavaScript 中是什么意思? [英] What does @@ ("at at") mean in ES6 JavaScript?

查看:23
本文介绍了@@(“at at")在 ES6 JavaScript 中是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到在 @@>很少 页面关于新的 ES6 特性,但我不知道它到底是什么意思(无论是实际的语法还是某种文档约定).而且很难用谷歌搜索.有人能解释一下吗?

I've noticed @@ used in a few pages about new ES6 features, but I don't know what exactly it means (whether it's actually syntax or just some kind of documentation convention). And it's hard to google. Can someone explain it?

推荐答案

@@ 描述了所谓的众所周知的符号.(请注意,它实际上不是 JS 中的有效语法.)根据 ES6/ES20151 规范:

@@ describes what's called a well-known symbol. (Note that it isn't actually valid syntax in JS.) According to the ES6/ES20151 specification:

众所周知的符号是本规范的算法明确引用的内置符号值.它们通常用作属性的键,其值用作规范算法的扩展点.除非另有说明,众所周知的符号值由所有代码领域 (8.2) 共享.

Well-known symbols are built-in Symbol values that are explicitly referenced by algorithms of this specification. They are typically used as the keys of properties whose values serve as extension points of a specification algorithm. Unless otherwise specified, well-known symbols values are shared by all Code Realms (8.2).

代码领域指的是 JavaScript 环境的不同实例.例如,根文档的代码领域将不同于在