Reputation: 21
Hey i wanna ask how to const all const in one like
const a = "a"
const b = "b"
const c = "c"
can I just
const all = `a,b,c`
??
Upvotes: 1
Views: 64
Reputation: 14891
You could use destructing assignment
const [a, b, c] = ["a", "b", "c"]
console.log(a, b, c)
Upvotes: 1
Reputation: 9411
Yes, you can do it like this:
const a="a", b="b", c="c"
Upvotes: 1