Content:-
"use strict" is a directive in JavaScript that enables strict mode, which is a way to write secure and efficient code.
When "use strict" is used at the beginning of a JavaScript file or a function, the JavaScript engine will execute the code in strict mode.
Assigning values to undeclared variables is not allowed.
"use strict";
x = 10; // Throws a ReferenceError: x is not defined
Deleting variables, functions, or arguments is not allowed.
"use strict";
var x = 10;
delete x; // Throws a SyntaxError: Deleting local variable in strict mode is not allowed
function myFunction() {
"use strict";
// code that runs in strict mode
}
On this page of the site you can watch the video online Part 21 | JavaScript Tutorial | use strict | Strict mode in JS with a duration of hours minute second in good quality, which was uploaded by the user Trinits Technologies 02 March 2023, share the link with friends and acquaintances, this video has already been watched 57 times on youtube and it was liked by 1 viewers. Enjoy your viewing!