JSFiddle - React, Tailwind, and code Playground

JavaScript

var o = { a: 'a', b: 'b', c: 'c' };

var keepGoing = true;
for (var k in o){
    switch (k){
        case 'b':
            keepGoing = false;
            break;
        default:
            console.log('Iteration: ' + k);
    }
    if (!keepGoing) break;
}
console.log('done');