Interviewer And Interviewee Guide

Expert Developer JavaScript Interview Question:

What is the 'Strict' mode in JavaScript and how can it be enabled?

Submitted by: Administrator
Strict Mode adds certain compulsions to JavaScript. Under the strict mode, JavaScript shows errors for a piece of codes, which did not show an error before, but might be problematic and potentially unsafe. Strict mode also solves some mistakes that hamper the JavaScript engines to work efficiently.

Strict mode can be enabled by adding the string literal "use strict" above the file. This can be illustrated by the given example:

JavaScript

function myfunction()
{
"use strict";
var v = "This is a strict mode function";
}
Submitted by:

Read Online Expert Developer JavaScript Job Interview Questions And Answers
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.