According to the specification of Array.prototype[@@iterator]
:
The initial value of the property @@iterator
is the same function-object as the initial value of the property Array.prototype.values
.
If you found the term "function-object" strange, be sure to refer to this another answer.
Thus, there is no difference between the two ways of executing this method. It is the exact same function, which is shared between these properties. There is also no difference in performance.
However, I believe that using the method values
is more preferred in this case, since it is a method created to be used directly by the developer. The @@iterator
, however, in addition to being less clear, it was implemented to be used by the language itself, as part of the iteration protocol of language.