For Of loops are new in Javascript and can be used to loop on any kind of iterable data except object.
Iterable data are Arrays, String, Map, Set, Generator etc. For Of loop does not loop over other properties of the prototype and other methods. It also allows us to interrupt the loop by using ‘break’ & ‘continue’ commands.
const kidsUsingTheFacilityRightNow = ['Megan', 'Roy', 'James', 'Louis']; for (const kidUsingTheFacilityRightNow of kidsUsingTheFacilityRightNow) { if (kidUsingTheFacilityRightNow === 'James') { continue; } console.log(kidUsingTheFacilityRightNow); }
Peace ✌️