Why can't I declare multiple const in JavaScript?
ecmascript-6, javascript
Solution
Because a const declaration has to be initialized as well. This will work:
const foo = 1, bar = 2;
Problem
This is correct syntax: `let foo, bar;` This is incorrect `const foo, bar;` Why is that? And is there a way to declare a number of constants in one place, and define them in another? Apart from bound declaration & definition.