let isBroken = false; colours.map(item => { if (isBroken) { return; } if (item.startsWith("y")) { console.log("The yessiest colour!"); isBroken = true; return; } });