Signup/Sign In

JavaScript Use Strict Directive - Test 1 Test

JavaScript Avg. Score: 2.02 184 Beginner
Q.1 What is the correct syntax to enforce strict mode in some JavaScript code?
Q.2 If you want to invoke strict mode for a JavaScript function, how will you do it?

In the following code, on which line number you should use 'use strict' to enforce strict mode for the given function.

// Placeholder 1

function myStrictFunction() {
    // Placeholder 2
    var result = 100;
    return result;
    // Placeholder 3
}

// Placeholder 4

 

Q.3 Which of the following in JavaScript are by default in strict mode?
Q.4 From the options given below, please select the one which is true about "use strict" and ECMAScript versions?
Q.5 What does the 'use strict' directive do in JavaScript?

Studytonight logo

Find me on YouTube

I make videos for Fullstack Dev, AWS, Ethical Hacking and Foundational stuff.