I have been reading many JavaScript codes recently and I was wondering of what are the benefits of using "use strict". Any idea would be very much appreciated.
I have been reading many JavaScript codes recently and I was wondering of what
Share
Before you go and put “use strict” on all your scripts, a warning:
Browsers that do not support strict mode, will run your code with different behavior from browsers that do.
Now, to answer your question. The benefits of strict mode are:
(Source: https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Functions_and_function_scope/Strict_mode)