My Report

JavaScript Basic Online 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. The escape sequence ‘\f’ stands for _________

2. JavaScript _________ when there is an indefinite or an infinite value during an arithmetic computation.

3. Assume that we have to convert “false” that is a non-string to string. The command that we use is (without invoking the “new” operator).

4. A hexadecimal literal begins with __________

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

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

6. The snippet that has to be used to check if “a” is not equal to “null” is _________

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

function compare()
{
    let a=1;
    let b='1';
    if(a.toString()===b)
        return true;
    else 
        return false;
}

8. JavaScript Code can be called by using ___________

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

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

10. The generalised syntax for a real number representation is __________

11. The type of a variable that is volatile is _______________

12. Which of the following is not considered as an error in JavaScript?

13. The statement a===b refers to _________

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

let a = 2;
let b = 4;
let ans = a + b;
console.log(ans);

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

function compare()
{
    let a=2.0;
    let b=2;
    if(a==b)
        return true;
    else
        return false;
}

 

Start practicing “1000 MCQs on JavaScript”, and once you are ready, you can take tests on all topics by attempting our “JavaScript Test Series”.

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.