DEV Community

Discussion on: "use strict"; in javascript

Collapse
 
willemodendaal profile image
Willem Odendaal

Useful summary, thank you! Do you know if it's necessary to add "use strict" if you're using Babel+Webpack?

Collapse
 
midasxiv profile image
Midas/XIV

I don't have enough experience with webpack. But a quick Google search indicated that it adds strict mode automatically, that too in global scope.

Collapse
 
bassemibrahim profile image
Bassem

Yeah! I am also wondering if "use strict" is still helpfull with IDE's autocomplete and Linting packages like ESLint.

Collapse
 
midasxiv profile image
Midas/XIV

Does Eslint help with eval variable leakage? 🤔.
Apart from that I don't think strict mode would be helpful.
I think in general it's a great interview question to just see if the candidate is curious or not.

Thread Thread
 
bassemibrahim profile image
Bassem

Yeah! Good to know in all cases