4 ms·
I keep wanting the else to run when the loop didn't iterate.
by compressedgas 6y ago
I keep wanting the else to run when the loop didn't iterate.
- slver 6y agoI thought about how I'd do this in JS, and it's paradoxically more compact and less confusing without dedicated syntax: if (leaders.some(i => i == "Yang")) { alert("Yang is a leader!"); } else { alert("Not found Yang!"); }