Array.from() // 将伪数组(类数组)变成真数组
function test() {
console.log(Array.isArray(arguments)); // arguments是伪数组
console.log(arguments.push); // undefine
// 将arguments变成真数组
arguments = Array.from(arguments);
console.log(Array.isArray(arguments));
}
test(1, 2, 3, 4, 5);
- find()
- findIndex()
- includes()
- keys() // 遍历键, 了解
- values() // 遍历值, 了解
- entries() // 遍历键值对, 了解