DEV Community

Avinashd
Avinashd

Posted on

Js in bits - 3 ('use strict')

Learning js should be fun. It is fun if it's easy.
I tried my best in writing this, to understand it the easy way.

'use strict'

Js is backwards compatible
The old code never breaks as they are not removed after all these years.

Image description

Problem: Because of this any bugs introduced at the start are still present today.

Image description

Solution: 'use strict'
It will result in error for old bugs.

Image description

Using 'use strict' at the start of .js file or start of function makes the rest of the code safe.

Image description

Leave y'r thoughts....

Top comments (0)