📅  最后修改于: 2022-03-11 15:01:22.440000             🧑  作者: Mango
let array = [1, 5, 6, true, "string", ["subarray", 5], 6];
let length = 0;
for (let i of array){
length++;
}
console.log(length)
// 7