JS Daily #18 - Variable Declaration Using Const
What is the output of following code?
const a; a = 10; a = 20; console.log(a);
Above code throws error in line 1. The error says
SyntaxError: Missing initializer in const declaration.
const variable should be initialized at the time of declaration itself like
const a = 10.