Why are constants called “constant variable” in Google Chrome console? [closed]

I’ve noticed that when you try to change a const value the Chrome Console console returns the following error: Uncaught TypeError: Assignment to constant variable. Are there any special reasons for …

Declare global constants in function javascript on DOMContentLoaded

Is there any way to declare constants when the DOMContentLoaded event triggers, that are accessible outside? window.addEventListener(‘DOMContentLoaded’, () => { const button = document….