Frontent Advanced
Module 01 - JavaScript
1. If you type the following code in the console window, what result will you get?
3 > 2 > 1 === false;
A. true
B. false
C. 1
D. NaN
2. JavaScript is a ___ -side programming language.
A. Client
B. Server
C. Both
D. None
3. Which of the following will write the message “Hello World!” in an alert box?
A. alertBox(“Hello World!”);
B. alert(Hello World!);
C. msgAlert(“Hello World!”);
D. alert(“Hello World!”);
4. How do you find the minimum of x and y using JavaScript?
A. min(x,y);
B. Math.min(x,y)
C. Math.min(xy)
D. min(xy);
5. If the value of x is 40, then what is the output of the following program?
(x % 10 == 0)? console.log(“Divisible by 10”) : console.log(“Not divisible by 10”);
A. ReferenceError
B. Divisible by 10
C. Not divisible by 10
D. None of the above
6. Which JavaScript label catches all the values, except for the ones specified?
A. catch
B. label
C. try
D. default
7. Which are the correct “if” statements to execute certain code if “x” is equal to 2?
A. if(x 2)
B. if(x = 2)
C. if(x == 2)
D. if(x != 2 )
8. What is the output of the following code in the console?
var x = 0;
function fun(){
++x;
this.x = x;
return x;
var bar = new fun();
console.log(bar.x);
A. ReferenceError
B. undefined
C. 1
D. TypeError
9. Which is the correct JavaScript syntax to change the HTML content given below?
<p id=”test”>Hello World!</p>
A. document.getElementById(“test”).innerHTML = “Hello World!”;
B. document.getElementsById(“test”).innerHTML = “Hello World!”;
C. document.getElementById(test).innerHTML = “Hello World!”;
D. document.getElementByTagName(“p”)[0].innerHTML = “Hello World!”;
10. Javascript is a _____ language.
A. Programming
B. Application
C. Scripting
D. None of the above
11. Which of the following purpose, JavaScript is designed for ?
A. To Execute Query Related to DB on Server
B. To Style HTML Pages
C. To Perform Server Side Scripting Opertion
D. To add interactivity to HTML Pages.
12. JavaScript code is written inside file having extension
A. .jvs
B. .js
C. .jsc
D. .javascript
13. What are the three important manipulations done in a for loop on a loop variable?
A. Updation, Incrementation, Initialization
B. Initialization,Testing, Updation
C. Testing, Updation, Testing
D. Initialization,Testing, Incrementation
14. What kind of expression is "new Point(2,3)"?
A. Primary Expression
B. Object Creation Expression
C. Invocation Expression
D. Constructor Calling Expression
15. Which event is triggered automatically at certain interval?
A. setTimeout
B. setTimer
C. Timeout
D. interval