let a, b, c, d; b = 5; [a, b, c, d] = [a, b, c, d].map(a => a === void 0 ? "-" : a); console.log(a, b, c, d)