Development - Java Script Test

Test Instructions :

1. The Test is 1hr duration.
2. The Test Paper consists of 30 questions. The maximum marks are 30.
3. All the questions are multiple choice question type with three options for each question.
4. Out of the three options given for each question, only one option is the correct answer.
5. Each question is allotted 1 mark for each correct response.
6. 0.25 will be deducted for incorrect response of each question.
Start Test

   Time Left : 00 : 30    : 00

Which of the following is not an logical operator ?

  

  

  

  

Is it necessary to use "var" keyword while declaring variable.

  

  

Variable declared outside JavaScript Function is called as _______________ .

  

  

<script src="../main.js"></script>

This code will include External JS inside your webpage.

  

  

Conditional Operator shown in the following example is _____________.

marks = (mark<35)?"Fail":"Pass";

 

  

  

  

  

JavaScript is a _______________ language

  

  

  

  

If a string cannot be converted to a number __________ will be returned.

  

  

  

  

A statement block is a

  

  

  

  

Java Script Variable should be Case ___________.

  

  

Which attribute is used to specifies that the script is executed when the page has finished parsing (only for external scripts)

  

  

  

  

-Infinity in JS gets added with +Infinity then output of the code will be.

  

  

  

+Infinity in JS gets added with +Infinity then output of the code will be -

  

  

  

var str = "Str";
var num = 10;
var output = str + num;

What will be the value of Variable 'output' ?

  

  

  

  

Microsoft Developed a compatible dialect of JavaScript called _____________.

  

  

  

  

The generalised syntax for a real number representation is

  

  

  

  

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

  

  

  

  

function message() {
    var name = "Pritesh";
    alert(name);
}

Variable declared above is example of ___________ Variable.

  

  

Following JS Code Consists of different Type of Statements -

<script type="text/javascript">
    var i = 10;
    if (i < 10) {
        document.write("<h1>This is a heading</h1>");
        document.write("<p>This is a paragraph.</p>");
        document.write("<p>This is another paragraph.</p>");
    }
</script>

What are different Type of statements written inside above JS.

  

  

  

  

  

"===" operator is _______________.

  

  

  

  

Is this correct syntax to include JS Code inside HTML Page ?

<script type="text/javascript">
...
</script>

 

  

  

Integer Variable is declared using following syntax in JavaScript.

  

Integer num;

 

  

var num;

 

  

int num;

 

  

integer num;

 

In March 1996, _______________ was released, featuring support for JavaScript.

  

  

  

  

State the correct place of JS Code inside HTML -

  

  

  

  

It is good to include JS code inside footer section in order to speed up the Page loading time of Webpage.

  

  

Initialization of variable can be done by writing _____ operator in between variable name and operand value.

  

  

  

  

JavaScript is designed for following purpose 

  

  

  

  

Single Line Comment Starts with _________ Symbol.

  

  

  

  

JavaScript was originally developed under the name _______.

  

  

  

  

JavaScript Code is written inside file having extension __________.

  

  

  

  

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++;
}

 

  

  

  

  

Why so JavaScript and Java have similar name?

  

  

  

  

We can declare all type of variables in JavaScript with the keyword _____________.

  

  

  

  

<html>
    <body>
        <script>
            var x = 12.45;
            var y = 1;
            var z = '8' + x + y;
            document.write(z + "<br>");
        </script>
    </body>
</html>

Value of Z is

  

  

  

  

Which was the first browser to support JavaScript ?

  

  

  

  

Executable single line of Script is called as _________________.

  

  

  

  

If the values on either side of '+' operator are numerical values then ___________.

  

  

  

JavaScript was invented at _______ Lab .

  

  

  

  

Multiple JS statements are written inside pair of ________ to form a statement block.

  

  

  

  

Variable declared inside JavaScript Function will be called as ____________.

  

  

A hexadecimal literal begins with

  

  

  

  

JavaScript Statement may contain HTML Tags. Say True/False.

  

  

JavaScript Statements are executed by ________ .

  

  

  

  

JavaScript is Case Sensitive !!Say True or False

  

  

Variable can hold ________ value at a time

  

  

  

  

"async" attribute is used to include External JS Code Asynchronously.

<script src="main.js" async="async"></script>

 

  

  

A conditional expression is also called a

  

  

  

  

The main purpose of a “Live Wire” in NetScape is to

  

  

  

  

In multiple line comment , End of the comment is specified by ________ Symbol.

  

  

  

  

<html>
    <body>
        <script>
            var name = "John Doe";
            var name = 123;
            document.write(name + "<br>");
        </script>
    </body>
</html>

Is it possible to change the type of value after re-assignment.

  

  

  

  

JavaScript contains a _________________ that assigns a value to a variable based on some condition.

  

  

  

  

Which of the following operators not comes under assignment Operator ?Select all possible options.

  

  

  

  

Which of the following is considered as End of Single line comment ?

  

  

  

  

var var1 = "Pritesh";

Above variable can store value of type.

  

  

  

  

"++" is __________ type of operator.

  

  

  

  

Comments in JS are ignored by ____________.

  

  

  

  

Which of the following is not a comparison operator ?

  

  

  

  

  

We can declare ___________ at a time. Select most appropriate option.

  

  

  

  

We cannot Place JS Code in the body tag . Say true/false.

  

  

Which of the following statement is used to declare variable in JavaScript ?

  

  

  

  

When there is an indefinite or an infinity value during an arithmetic value computation, javascript

  

  

  

  

Why JavaScript is called as Lightweight Programming Language ?

  

  

  

  

The type of a variable that is volatile is

  

  

  

  

Vriables declared inside function are visible _______________.

  

  

  

  

Group of JavaScript Statements is called as _________.

  

  

  

  

"+=" operator can operate on following data values.

  

  

  

  

The output for the following code snippet would most appropriately be

var a=5 , b=1
var obj = { a : 10 }
with(obj) 
{
      alert(b)
}

 

  

  

  

  

What will be the output of the following script ?

<!DOCTYPE html>
<html>
    
    <body>
        <script>
            var x = 5;
            document.write(x == "5");
        </script>
    </body>

</html>

 

  

  

  

  

JavaScript code contain sequence of ___________.

  

  

  

  

Local Variables are destroyed after execution of function.

  

  

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) ?

  

  

  

  

Variable declared without a value will have the value ______________.Eg.

var num;

 

  

  

  

undefined

 

  

Java Script have following type of Comment(s) -

  

  

  

  

What will be the value of Variable - "num3" ?

var num1; 
var num2 = 10;
var num3 = num1 + num2;

 

  

  

  

  

During addition of two numbers , suppose one of the number is NaN then output of the following code will be ?

  

  

  

  

What will be printed on the screen ? Var3 =100101010

  

  

  

  

When an empty statement is encountered, a JavaScript interpreter

  

  

  

  

What will be the output of the following script ?

<!DOCTYPE html>
<html>
    <body>
        <script>
            var x = 5;
            document.write(x === "5");
        </script>
    </body>
</html>

 

  

  

  

  

<script type="text/javascript">
{
document.write("<h1>This is a heading</h1>");
document.write("<p>This is a paragraph.</p>");
document.write("<p>This is another paragraph.</p>");
}
</script>

HTML Tags are allowed inside JS. Is this error free code ?

  

  

Which of the following operator is used to concatenate two strings.

  

  

  

  

The script tag must be placed in

  

  

  

  

JavaScript is ______ Side Scripting Language.

  

  

  

  

var num=20;

Above Statement is called as __________ Statement. Select all the appropriate options.

  

  

  

  

"Add and Assignment" operator is shown by this symbol.

  

  

  

  

<script type="text/javascript">
    var name;
    name = "Pritesh";
</script>
<script type="text/javascript">
    document.write(name);
</script>

What will be the output of the following ?

  

  

  

  

______ attribute is used to specify the character encoding used in an external script file.

  

  

  

  

<!DOCTYPE html>
<html>
    <body>
        <script>
            var x = 5;
            var y = 6;
            var z = 5 + 6;
            document.write(x + "<br>");
            document.write(y + "<br>");
            document.write(z + "<br>");
        </script>
    </body>
</html>

Guess output of the following code.

  

5
6
11



  

5
6
56

 

  

5
6
10

 

  

"++" can operate only on ________________.

  

  

  

  

The “var” and “function” are

  

  

  

  

Person XYZ wrote his name and date of code creation at the start , What kind of comment he has written ?

  

  

  

  

/* This is Simple Comment */

This is the example of ____________ Comment.

  

  

Is this placement of JS code inside HTML Element is Error Free ?

<html><head><title>My Page</title>
</head>
<body>
<a href="javascript:myFunction();">Click here</a>
<script language="javascript" type="text/javascript">
function myFunction() {
    alert('Hello world');
}
</script>
</body>
</html>

 

  

  

Consider the following statements

var count = 0;
while (count < 10) 
{
     console.log(count);
     count++;
}

In the above code snippet, what happens?

  

  

  

  

It is not necessary to write Semicolon at the end of JS statement !!

  

  

-Infinity in JS gets added with -Infinity then output of the code will be.

  

  

  

Guess the ternary operator used in the following example !!!

marks = (mark<35)?"Fail":"Pass";

 

  

  

  

  

JavaScript is also called as _____________.

  

  

  

  

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

  

  

  

  

Java Statement terminated by ______________ ,

  

  

  

  

JS code included inside head section is loaded before loading page.

  

  

Which of the following Attribute is used to include External JS code inside your HTML Document -

  

  

  

  

Note:
  • Click the 'Submit Test' button given in the bottom of this page to Submit your answers.
  • Test will be submitted automatically if the time expired.
  • Don't refresh the page.