Vidyalelo
JavaScript · all questions

Basic And Variables
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

83

Questions

2/5

Page

Pick an option on a question to see the right answer and solution.

Consider the following snippet code
var string1 =123”;
var intvalue = 123;
alert( string1 + intvalue );
The result would be

Select an option to see the answer and solution.

A function definition expression can be called

Select an option to see the answer and solution.

The property of a primary expression is

Select an option to see the answer and solution.

Consider the following statements
var text = "testing: 1, 2, 3"; // Sample text
var pattern = /d+/g // Matches all instances of one or more digits
In order to check if the pattern matches with the string “text”, the statement is

Select an option to see the answer and solution.

The JavaScript’s syntax calling ( or executing ) a function or method is called

Select an option to see the answer and solution.

What kind of an expression is “new Point(2,3)”?

Select an option to see the answer and solution.

Which of the operator is used to test if a particular property exists or not?

Select an option to see the answer and solution.

Among the following, which one is a ternary operator?

Select an option to see the answer and solution.

“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

Select an option to see the answer and solution.

JavaScript is a _______________ language

Select an option to see the answer and solution.

The output for the following code snippet would most appropriately be
var a=5 , b=1
var obj = { a : 10 }
with(obj) 
{
      alert(b)
}

Select an option to see the answer and solution.

The output for the following code snippet would most appropriately be
var a=5 , b=1
var obj = { a : 10 }
with(obj) 
{
      alert(b)
}

Select an option to see the answer and solution.

A conditional expression is also called a

Select an option to see the answer and solution.

Which is a more efficient code snippet ?
Code 1 :
for(var num=10;num>=1;num--)
{
    document.writeln(num);
}

Code 2 :
var num=10;
while(num>=1)
{
    document.writeln(num);
    num++;
}

Select an option to see the answer and solution.

A statement block is a

Select an option to see the answer and solution.

When an empty statement is encountered, a JavaScript interpreter

Select an option to see the answer and solution.

The “var” and “function” are

Select an option to see the answer and solution.

Consider the following statements
switch(expression)
{
    statements
}
In the above switch syntax, the expression is compared with the case labels using which of the following operator(s) ?

Select an option to see the answer and solution.

Consider the following statements
var count = 0;
while (count < 10) 
{
     console.log(count);
     count++;
}
In the above code snippet, what happens?

Select an option to see the answer and solution.

The enumeration order becomes implementation dependent and non-interoperable if :

Select an option to see the answer and solution.