Developers may accidentally declare global variable without their knowledge.
To avoid developers from creating global variable you can use strict mode as given below. .
If we use strict method; when we debug we will get an exception on the line where we have declared global variables. See the screenshot below.