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)

The Most Contextual AI Development Assistant

Pieces.app image

Our centralized storage agent works on-device, unifying various developer tools to proactively capture and enrich useful materials, streamline collaboration, and solve complex problems through a contextual understanding of your unique workflow.

👥 Ideal for solo developers, teams, and cross-company projects

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay