Can I use continue and break in Javascript for…in and for…of loops?
Yep – works in all loops. const myObject = { propA: ‘foo’, propB: ‘bar’ }; for (let propName in myObject) { console.log(propName); if (propName !== ‘propA’) { continue; } else if (propName === ‘propA’) { break; } } (By loops I mean for, for…in, for…of, while and do…while, not forEach, which is actually a function … Read more