There's no way this hasn't been documented somewhere already, but it just dawned on me last week, and I thought it was pretty neat!
const [var1, var2, var3] = someVar ? ['true value 1', 'true value 2', 'true value 3'] : ['false value 1', 'false value 2', 'false value 3'];
Not too bad, eh?
Leave A Comment