Can I use the break
and continue
statements inside the for...in
and for...of
type of loops? Or are they only accessible inside regular for
loops.
Example:
myObject = {
propA: 'foo',
propB: 'bar'
};
for (let propName in myObject) {
if (propName !== 'propA') {
continue;
}
else if (propName === 'propA') {
break;
}
}
propName
in my code", would you still say it's a good question? – Croix