1、for...in + hasOwnProperty
2、先通过Object.entries()、Object.keys()、Object.values()转成数组,然后forEach 【推荐】
1、Array.prototype.forEach((item, index, arr) => {}, thisArg) 【推荐】
2、for...of
3、for
1、Map.prototype.forEach((item, index, arr) => {}, thisArg) 【推荐】
1、Set.prototype.forEach((item, index, arr) => {}, thisArg) 【推荐】
Last updated 2 years ago