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

Non Initialized Variable have value "undefine", What value be printed in following case.

var carname="Volvo"; 
var carname;

 

  

  

  

  

Choose the client-side JavaScript object?

  

  

  

  

_________ is a wrapped Java array, accessed from within JavaScript code.

  

  

  

  

Conditional Operator shown in the following example is _____________.

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

 

  

  

  

  

What are variables used for in JavaScript Programs?

  

  

  

  

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

  

  

JavaScript is invented by ________.

  

  

  

  

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.

  

  

  

  

  

What will be printed on the screen ? Var3 =100101010

  

  

  

  

Which company developed JavaScript?

  

  

  

  

Group of JavaScript Statements is called as _________.

  

  

  

  

<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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

"++" can operate only on ________________.

  

  

  

  

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

 

  

  

  

  

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

  

  

  

  

Which of the following is not a compound assignment operator.

  

  

  

  

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

var num;

 

  

  

  

undefined

 

  

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

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

 

  

  

  

  

_______ class provides an interface for invoking JavaScript methods and examining JavaScript properties.

  

  

  

  

Which of the following is not a comparison operator ?

  

  

  

  

  

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

  

  

  

  

JavaScript Code can be called by using _________.

  

  

  

  

In the below notation, Employee is of type { “Employee”: [ “Amy”, “Bob”, “John” ] }

  

  

  

  

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

  

  

  

  

The generalised syntax for a real number representation is

  

  

  

  

Which of the following is correct about features of JavaScript?

  

  

  

  

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

  

  

Choose the server-side JavaScript object?

  

  

  

  

JavaScript Code is written inside file having extension __________.

  

  

  

  

How to create a Date object in JavaScript?

  

  

  

  

Consider the following statements

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

In the above code snippet, what happens?

  

  

  

  

JavaScript is Case Sensitive !!Say True or False

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

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

This code will include External JS inside your webpage.

  

  

Single Line Comment Starts with _________ Symbol.

  

  

  

  

When an empty statement is encountered, a JavaScript interpreter

  

  

  

  

When you assign a text value to a variable, we put text value in the pair of _________.

  

  

  

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

  

  

  

  

/* This is Simple Comment */

This is the example of ____________ Comment.

  

  

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

  

  

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

  

  

  

  

Which of the following is the correct syntax to display “Welcome” in an alert box using JavaScript?

  

  

  

  

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

  

  

  

Which types of image maps can be used with JavaScript?

  

  

  

  

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

  

  

<script type="text/javascript">
var s = "9123456 or 80000?";
var pattern = /\d{4}/;
var output = s.match(pattern);
document.write(output);
</script>

What is the output?

  

  

  

  

Which is the correct way to write a JavaScript array?

  

var txt = new Array(1:"tim",2:"kim",3:"jim")

 

  

var txt = new Array:1=("tim")2=("kim")3=("jim")

 

  

var txt = new Array("tim","kim","jim")

 

  

var txt = new Array="tim","kim","jim"

 

To set up the window to capture all Click events, we use which of the following statement?

  

  

  

  

var num;

Above Statement is called as __________ Statement.

  

  

  

  

JavaScript code contain sequence of ___________.

  

  

  

  

Comments in JS are ignored by ____________.

  

  

  

  

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

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

 

  

  

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

  

  

  

  

<!DOCTYPE html>
<html>
    <body>
        <script>
            var num1 = 1;
            var num2 = 1;
            var num3 = "1" + num1 + num2;
            document.write(num1 + "<br>");
            document.write(num2 + "<br>");
            document.write(num3 + "<br>");
        </script>
    </body>
</html>

Guess output of the following code.

  

  

  

  

What is mean by "this" keyword in javascript?

  

  

  

  

Which of the following function of Array object returns the last (greatest) index of an element within the array equal to the specified value, or -1 if none is found?

  

  

  

  

State the correct place of JS Code inside HTML -

  

  

  

  

Using _______ statement is how you test for a specific condition.

  

  

  

  

JavaScript is interpreted by _________

  

  

  

  

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

What will be the value of Variable 'output' ?

  

  

  

  

Variable declared inside JavaScript Function will be called as ____________.

  

  

JavaScript is _________ language.

  

  

  

  

Which of the following function of String object returns a string representing the specified object?

  

  

  

  

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

  

  

  

JavaScript is also called as _____________.

  

  

  

  

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

  

  

<html>
<body>
<script type="text/javascript">
<!--
document.print("Hello");
//-->
</script>
</body>
</html>

What will be the Output of the above Code ?

  

  

  

  

The syntax of capture events method for document object is ______________

  

  

  

  

Which JavaScript variable cannot be used as First character but can be use after first character ?

  

  

  

  

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

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

 

  

  

  

  

Which of the following is not JavaScript Data Types?

  

  

  

  

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

  

  

  

  

The statement a===b refers to

  

  

  

  

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

Guess output of the following code.

  

  

  

  

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

  

  

  

  

The syntax of Eval is ________________

  

  

  

  

JavaScript Code can be called by using _________.

  

  

  

  

Comment Statement is _________________ type of statement.

  

  

  

  

<script type="text/javascript">
x=4+"4";
document.write(x);
</script> 

What is the output.?

  

  

  

  

Which was the first browser to support JavaScript ?

  

  

  

  

Which tag(s) can handle mouse events in Netscape?

  

  

  

  

The syntax of a blur method in a button object is ______________

  

  

  

  

The type of a variable that is volatile is

  

  

  

  

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>

 

  

  

Which of the following way can be used to indicate the LANGUAGE attribute?

  

  

  

  

____________ is the tainted property of a window object.

  

  

  

  

What does the tag do?

  

  

  

  

Spaces,Punctuation marks are called as __________ Symbols in JavaScript.

  

  

  

  

In JavaScript, Window.prompt() method return true or false value ?

  

  

Java Script Variable should be Case ___________.

  

  

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

  

  

  

  

In JavaScript, _________ is an object of the target language data type that encloses an object of the source language.

  

  

  

  

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 contains a _________________ that assigns a value to a variable based on some condition.

  

  

  

  

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

  

  

  

  

<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.

  

  

  

  

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.