let array = [1, 5, 6, true, "string", ["subarray", 5], 6]; let length = 0; for (let i of array){ length++; } console.log(length) // 7