In Google Style guide for JavaScript written (prove link), that using a "const" construction is a bad practice, why?
Because it is not standard (yet). It's a JavaScript 1.5 keyword, not ECMAScript. From the MDN documentation:
The current implementation of
constis a Mozilla-specific extension and is not part of ECMAScript 5. It is supported in Firefox & Chrome (V8) and partially supported in Opera 9+ and Safari. It is not supported in Internet Explorer 6-9, or in the preview of Internet Explorer 10. Theconstkeyword currently declares the constant in the function scope (like variables declared with var).
Also if you read the section you linked to carefully, the last sentence is:
As for the
constkeyword, Internet Explorer doesn't parse it, so don't use it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With