Javascript MCQ Questions PDF
Javascript MCQ Questions PDF
1. 00
2. 0x
3. 0X
4. Both 0x and 0X
1. Missing of semicolons
2. Syntax error
3. Division by zero
4. Missing of Bracket
1. Dynamic variable
2. Mutable variable
3. Volatile variable
4. Immutable variable
5. Which of the following given functions of the Number Object formats a number with
a different number of digits to the right of the decimal?
1. toPrecision()
2. toFixed()
3. toExponential()
4. toLocaleString()
Answer: toFixed()
6. Which of the following function of the String object returns the character in the
string starting at the specified position via the specified number of characters?
1. split()
2. slice()
3. substr()
4. search()
Answer: substr()
7. Which one of the following is the correct way for calling the JavaScript code?
1. Triggering Event
2. Preprocessor
3. Function/Method
4. RMI
Answer: Function/Method
8. Which of the following number object function returns the value of the number?
1. valueOf()
2. toString()
3. toLocaleString()
4. DtoPrecision()
Answer: valueOf()
10. Which of the following variables takes precedence over the others if the names are
the same?
11. Choose the correct snippet from the following to check if the variable "a" is not
equal the "NULL"_______
1. if(a!==null)
2. if (a!)
3. if(a!=null)
4. if(a!null)
Answer: if(a!==null)
1. Keywords
2. Data types
3. Prototypes
4. Declaration statements
13. Suppose we have a text "human" that we want to convert into string without using
the "new" operator. Which is the correct way from the following to do so___________
1. String newvariable="human"
2. String(human)
3. toString()
4. Both human.toString() and String(human)
14. In JavaScript, what will be used for calling the function definition
expression_______
1. Function literal
2. Function calling
3. Function prototype
4. Function declaration
15. Which of the following one is the property of the primary expression_________
16. Which one of the following is used for the calling a function or a method in the
JavaScript__________
1. Invocation expression
2. Functional expression
3. Property Access Expression
4. Primary expression
1. Throws an error
2. Prompts to complete the statement
3. Shows a warning
4. Ignores the statements
1. Invocation Expression
2. Primary Expression
3. Object Creation Expression
4. Constructor Calling Expression
19. Which one of the following operator is used to check weather a specific property
exists or not__________
1. in
2. exist
3. Exists
4. within
Answer: in
20. What if we define a "for" loop and it removes one of the properties that has not yet
been enumerated?
1. with
2. if
3. debugger
4. use strict
Answer: use strict
22. Which one of the following is not considered as "statement" in the JavaScript?
1. with
2. if
3. debugger
4. use strict
Answer: block that combines a number of statements into a single compound statement
24. In a case, where the value of the operator is NULL , the typeof returned by the
unary operator is__________.
1. string
2. undefined
3. boolean
4. object
Answer: object
1. +
2. ?
3. :
4. -
Answer: ?
1. Switch statement
2. Alternative to if-else
3. If-then-else statement
4. immediate if
Answer: immediate if
27. Which one of the following operator returns false if both values are equal?
1. ==
2. !==
3. !
4. &&
Answer: ==
28. "An expression that can legally appear on the left side of an assignment expression."
is a well known explanation for variables, properties of objects, and elements of arrays.
They are called_____
1. Prototypes
2. Properties
3. Definition
4. Lvalue
Answer: Lvalue
29. What we will get if we compare the "one" with "8" using the less than operator
("one"<8)?
1. NaN
2. True
3. False
4. Undefined
Answer: False
1. Object-Based
2. Object-Oriented
3. Assembly-language
4. High-level
Answer: Object-Based