My Report

JavaScript Practice Test 1


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 role of the continue keyword in the following JavaScript code snippet?

while (a != 0)
{
   if (a == 1) 
       continue;
   else 
       a++;
}

2. To determine whether one object is the prototype of (or is part of the prototype chain of) another object, one should use the ____________

3. The expression of calling (or executing) a function or method in JavaScript is called ________

4. Among the following, which one is a ternary operator?

5. A hexadecimal literal begins with __________

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

var string1 = ”123”;
var intvalue = 123;
alert( string1 + intvalue );

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

let a;
if (a !== null)
    return 1;
else
    return 0;

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

function output(object)
{
	var place=object ? object.place : “Italy”;
	return “clean:”+ place;
}
console.log(output({place:India}));

9. A JavaScript program developed on a Unix Machine ________

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

function equalto()
{
    let num=10;
    if(num==="10")
        return true;
    else
        return false;
}

 

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.