我想知道在使用 @@ iterator
函数与 Symbol.iterator
one:
I was wondering if there was a specific difference in implementing an iterator using the @@iterator
function versus the Symbol.iterator
one:
在MDN上有一个 Array.prototype。@@ iterator
,但在示例本身中,使用Symbol.iterator作为函数名。这只是更新的版本,而 @@ iterator
不再有效,还是两者都有效?
On MDN, there is a page on Array.prototype.@@iterator
, yet in the examples itself, Symbol.iterator is used as the function name. Is this just the updated version and @@iterator
is not valid anymore, or are both of them valid?