My Report

JavaScript Practice Test 2


Correct Answer: 2 points | Wrong: -1 point
Grades: A* (100% score) | A (80%-99%) | B (60%-80%) | C (40%-60%) | D (0%-40%)
advertisement

1. What will be the output of the following JavaScript code?

var arr = [7, 5, 9, 1];  
var value = Math.max.apply(null, arr);  
document.writeln(value);  

2. What will be the output of the following JavaScript code?

var a=225;
document.writeln(Math.sqrt(a));  

3. When does the function name become optional in JavaScript?

4. What is the fundamental rule of lexical scoping?

5. What can be done in order to avoid the creation of global variables in JavaScript?

6. The different variant of Date() constructor to create date object is/are ___________
i. new Date(date)
ii. new Date(milliseconds)
iii. new Date(date string)
iv. new Date(year, month, date[hour, minute, second, millisecond])

7. The keyword or the property that you use to refer to an object through which they were invoked is _________

8. What must be done in order to implement Lexical Scoping?

9. Why is this keyword not preferred in JavaScript?

10. Which was one of the first security subsets proposed?


 

Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.