JavaScript For Of Loop The for of statement loops through the values of an iterable object. let language = "JavaScript"; let text = ""; for (let x of language) { text += x + ""; } document.getElementById("demo").innerHTML = text; ...
Arrayv-forloops through the array, and the element and the index of each element can be picked out and used.Run Example » Objectv-forloops through the Object. The property names, values and indexes can be picked out and used.Run Example » ...