Strict Mode :
Strict mode in JavaScript is a way to opt into a restricted variant of the language.
It helps you write cleaner code by catching common coding errors and "unsafe" actions,
such as assigning to global variables unintentionally. When strict mode is enabled,
some silent errors are converted to throw errors, which makes debugging easier.
'use strict'; // use or try js file 1st commend
let user = "Dhoni" ;
//user= " ms Dhoni" correct method
//variable Spelling mistake ithukku dhan strict mood use panrom.
use ="ms Dhoni" //Error assignment undeclard variable use
console.log (user) ;
Output:
Dhoni
//Keyword
const interface = 'car' //Error Reserve keyword
const private = 'jack' //Error strict mood use pannalana error show agathu nama dhan identity pannannum.
Top comments (0)