0
What can i use in JS as #define in C?
As #define is used to add constant in C. What can i use in JS instead of this.?
2 Answers
+ 4
Learn Webassembly, it compiles C codes into browser's assembly codes that could work together with Javascript functions.
+ 2
From what I read in the following article, before ES6 there is no easy and standard way to define a constant, but it all changed with ES6 and its const keyword. However, in other articles I found some mentioned that the const keyword is not cross-browsers feature, can't verify that fact still.
https://dzone.com/articles/how-to-create-constants-in-javascript