Javascript Programming Quiz


Play this Javascript quiz that will help you to excel in Javascript certification exams, placements etc. This Javascript programming quiz consist of 10 questions that you need to solve in 10 minutes. We’ve specially designed this quiz so that you can quickly acquaint to the pattern of questions you can be asked in placement drives, certification exams etc. This Javascript programming test enables you to assess your knowledge of Javascript programming.

Take the Free Practice Test



Javascript MCQs

Practice Javascript MCQ Questions, which will help you to clear your JS related concepts and also helps you to prepare for placements, technical rounds, interviews, competitive exams etc.

Javascript Quiz

Try Free Javascript Quiz, to start a quiz you need to login first, after login you will get start quiz button and then by clicking on that you can start quiz. You will get 10 Minutes to answer all questions.

Javascript Quiz

1. The syntax for adding a property to an object is?

objectProperty == propertyValue;
objectProperty = propertyValue;
objectName.objectProperty = propertyValue;
objectName.objectProperty == propertyValue;

2. Consider the following JavaScript statement containing regular expressions and check if the pattern matches?

var text = "lestfindcourse: 1, 2, 3"; 
var pattern = /d+/g;

text==pattern
text.equals(pattern)
text.test(pattern)
pattern.test(text)

3. The regular expression to match any one character not between the brackets is __________

[....]
[^]
[^...]
[\D]

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

System.out.println( Pattern.matches("\d", "9") );

true
false
undefined
9

5. which operator outputs the remainder of an integer division?

Add
Subtraction
Modulus
Increment

6. What will be the output of the below code?

class Rect {
constructor(h, w) {
this.height = h;
this.width = w;
}
get foo() {
return this.foo();
}
foo() {
return this.height * this.width;
}
}

const sq = new Rect(5, 20);
console.log(sq.foo());

this.height * this.width
100
Reference Error
5*20

7. byte is reserved word in Javascript?

Yes
No
Can be yes or no
Can not say

8. What would be the result of the following statement in JavaScript using regular expression methods?

Returns ["123""456""789"]
Returns ["123","456","789"]
Returns [1,2,3,4,5,6,7,8,9]
Throws an exception

9. what will be the output of below code?

var val = "JavaScript String"
splittedVal = val.split('a',2)
console.log(splittedVal);

[ 'J', 'v' ]
[ 'J' ,'v','Script']
[ 'J', 'v', 'Script String' ]
[ 'JavaScript String' ]

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

int x=0;
for(x;x<10;x++);
console.log(x);

0
9
10
error

Results