What does “use strict” do in JavaScript, and what is the reasoning behind it?

前端 未结 28 3136
半阙折子戏
半阙折子戏 2020-11-21 06:05

Recently, I ran some of my JavaScript code through Crockford\'s JSLint, and it gave the following error:

Problem at line 1 character 1: Missing \"use

28条回答
  •  情歌与酒
    2020-11-21 06:29

    Including use strict in the beginning of your all sensitive JavaScript files from this point is a small way to be a better JavaScript programmer and avoid random variables becoming global and things change silently.

提交回复
热议问题