Why Does JavaScript Need to Start with 'use strict'?



JavaScript uses a semi-colon (;) to avoid any confusion in code, especially the beginning of a new line.

Example

You can still use the following to avoid any chaos in the code −

return {
   'var':myVal
}

// using semi-colon;
(function( $ ) {
   //
}
Ramu Prasad
Ramu Prasad

Updated on: 2020-06-23T11:51:06+05:30

146 Views

Kickstart Your Career

Get certified by completing the course

Get Started