What is actually @@iterator. Is this a symbol literal or something? I see it mentioned in many tutorials but no one seems to explain what kind of animal it is really.
Asked
Active
Viewed 52 times
0
peter.petrov
- 36,377
- 12
- 75
- 137
-
Might also be of use: https://stackoverflow.com/questions/29492333/what-does-at-at-mean-in-es6-javascript – Nick Parsons Dec 29 '19 at 14:54
-
Thanks but I am still confused, so it is not part of the Javascript Syntax but they still use it widely to refer to the Symbol.iterator symbol constant?! Is that right? – peter.petrov Dec 29 '19 at 15:00
-
2yes, the @@ isn’t part of the JS syntax, it’s more just a notation used by the spec “within this specification a well-known symbol is referred to by using a notation of the form @@name” - http://www.ecma-international.org/ecma-262/6.0/#sec-well-known-symbols – Nick Parsons Dec 29 '19 at 15:06
1 Answers
4
It's Symbol.iterator, a well-known symbol.
The @@ naming is a convention used in the javascript language specification: http://www.ecma-international.org/ecma-262/6.0/#sec-well-known-symbols
Axnyff
- 8,235
- 3
- 31
- 36