davej 3183 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 3181 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!