SyntaxError: missing = in const declaration (Firefox) SyntaxError: Missing initializer in const declaration (Chrome)
const keyword. An initializer for a constant is required; that is, you must specify its value in the same statement in which it's declared (which makes sense, given that it can't be changed later).
let, you must specify a value for a
const declaration. This throws:
const COLUMNS; // SyntaxError: missing = in const declaration
There are multiple options to fix this error. Check what was intended to be achieved with the constant in question.
Specify the constant value in the same statement in which it's declared:
const COLUMNS = 80;
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.