0
Declaring Global Constants in JavaScript.
How do we declare constants globally in JS? For var, we could do: var a; const func = () => { a = 10; } We can't do that with const.. it has to be initialized when it is declared. How to make it global scope inside a function? This gives an error with 'use strict': const func = () => { a = 10; }
1 Réponse
0
Martin Taylor , the function wasn't what I was talking of.. It is just putting the a in it.