Echo JS 0.11.0

<~>

davej 3867 days ago. link 1 point ▲ ▼
Or of course (depending on your JS style preferences) you could use a ternary conditional expression:

let a = (x === 10) ? 1000 : (x > 10) ? 200 : 300;
kaizendad 3866 days ago. link 1 point ▲ ▼
I use the ternary approach a lot, but it's nice to see that do approach for longer conditionals. I expect I could use it a lot!