Blog Post

Multi-variable Zombie Punches

In JavaScript, you can define more than one variable at a time by using a comma between variable names. I’m using let below, but it works with var and const too.

let zombie, undead;Code language: JavaScript (javascript)

You can also set their values while chaining them:

let horde = 700, humanityInTrouble = true;Code language: JavaScript (javascript)