Object.prototype[Symbol.iterator] = function(){
return Object.values(this)[Symbol.iterator]();
}
let [a, b] = { a: 1, b: 2 }
console.log(a, b)
Object.prototype[Symbol.iterator] = function(){
return Object.values(this)[Symbol.iterator]();
}
let [a, b] = { a: 1, b: 2 }
console.log(a, b)
本文标题:Iterator 和 for...of 循环
本文链接:https://www.haomeiwen.com/subject/amjspdtx.html
网友评论