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

Single Line Comment Starts with _________ Symbol.

  

  

  

  

JS Comment can be used for following purposes

  

  

  

  

Comment Statement is _________________ type of statement.

  

  

  

  

State the correct place of JS Code inside HTML -

  

  

  

  

Vriables declared inside function are visible _______________.

  

  

  

  

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.

  

  

  

  

  

Group of JavaScript Statements is called as _________.

  

  

  

  

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

What is the output.?

  

  

  

  

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

  

  

  

  

JavaScript entities start with _______ and end with _________.

  

  

  

  

JavaScript syntax to change the content of the following HTML code

  

  

  

  

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

  

  

  

  

What will be printed inside webpage ?

var message="Hello JS";
document.write(Message);

 

  

  

  

  

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

  

  

  

  

What is the correct JavaScript syntax to write "Hello World"?

  

  

  

  

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

What will be the Output of the above Code ?

  

  

  

  

A statement block is a

  

  

  

  

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

  

  

  

  

Which types of image maps can be used with JavaScript?

  

  

  

  

JavaScript Code can be called by using _________.

  

  

  

  

Which of the following attribute can hold the JavaScript version?

  

  

  

  

var num;

Above Statement is called as __________ Statement.

  

  

  

  

If para1 is the DOM object for a paragraph, what is the correct syntax to change the text within the paragraph?

  

  

  

  

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>

 

  

  

JavaScript is _________ language.

  

  

  

  

Variable can hold ________ value at a time

  

  

  

  

The escape sequence ‘f’ stands for

  

  

  

  

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

  

  

  

  

How does JavaScript store dates in a date object? 

  

  

  

  

Microsoft Developed a compatible dialect of JavaScript called _____________.

  

  

  

  

Which of the following is not a compound assignment operator.

  

  

  

  

JavaScript Code can be called by using _________.

  

  

  

  

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

  

  

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

  

  

  

  

<script type="text/javascript">
// document.write("<h1>Heading</h1>");
document.write("<p>Google</p>");
document.write("<p>Yahoo</p>");
</script>

Which of the statement will be neglected by Browser ?

  

<p>Google</p>

 

  

<p>Yahoo</p>

 

  

<h1>Heading</h1>

 

  

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

  

  

  

Integer Variable is declared using following syntax in JavaScript.

  

Integer num;

 

  

var num;

 

  

int num;

 

  

integer num;

 

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

var carname="Volvo"; 
var carname;

 

  

  

  

  

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

  

  

  

JavaScript is invented by ________.

  

  

  

  

Conditional Operator shown in the following example is _____________.

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

 

  

  

  

  

_____ JavaScript statements embedded in an HTML page can respond to user events such as mouse-clicks, form input, and page navigation.

  

  

  

  

<script>
document.write(navigator.appCodeName);
</script>

What is the output?

  

  

  

Which company developed JavaScript?

  

  

  

  

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

  

  

  

  

Why so JavaScript and Java have similar name?

  

  

  

  

The syntax of Eval is ________________

  

  

  

  

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

  

  

  

  

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

  

  

Local Variables are Destroyed as soon as ______________.

  

  

  

  

JavaScript is ______ Side Scripting Language.

  

  

  

  

JSON strings have to be in

  

  

  

<!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 will be the value of Variable - "num3" ?

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

 

  

  

  

  

What are variables used for in JavaScript Programs?

  

  

  

  

JavaScript code contain sequence of ___________.

  

  

  

  

<html>
    <head>
        <title>A Simple Page</title>
        <script language="JavaScript">
            <!--
            var A = "Compile ",
                B = "Error";
            C = A + B;
            alert(C);
            //  -->
        </script>
    </head>
    <body></body>
</html>

What will be printed ?

  

  

  

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

  

  

  

  

Which of the following is the structure of an if statement?

  

  

  

  

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

  

  

  

  

A hexadecimal literal begins with

  

  

  

  

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

  

  

  

  

The “var” and “function” are

  

  

  

  

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

  

  

  

Consider the following statements

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

In the above code snippet, what happens?

  

  

  

  

What will be the output of the following script ?

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

</html>

 

  

  

  

  

Which of the following is correct about features of JavaScript?

  

  

  

  

The type of a variable that is volatile is

  

  

  

  

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

This code will include External JS inside your webpage.

  

  

Which of the following is not considered a JavaScript operator?

  

new

 

  

this

 

  

delete

 

  

typeof

 

Which best explains getSelection()?

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

What will be the value of Variable 'output' ?

  

  

  

  

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

  

  

"===" operator is _______________.

  

  

  

  

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

  

  

  

  

JavaScript is Case Sensitive !!Say True or False

  

  

Scripting language are

  

  

  

"++" is __________ type of operator.

  

  

  

  

/* This is Simple Comment */

This is the example of ____________ Comment.

  

  

The development environment offers which standard construct for data validation

  

  

  

  

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

  

  

  

  

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

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

 

  

  

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

  

  

  

  

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

  

  

  

  

JavaScript is interpreted by _________

  

  

  

  

Executable single line of Script is called as _________________.

  

  

  

  

What type of value gets printed if we add following two variables.

var a = "1";
var b = 5;

 

  

  

  

  

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

Above Code contain one executive Statement. Guess the Output of the Above Code.

  

  

  

  

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

  

  

  

  

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"

 

JavaScript is ideal to

  

  

  

  

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

  

  

  

  

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

  

  

  

  

var num=20;

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

  

  

  

  

What does the tag do?

  

  

  

  

What is the correct syntax for referring to an external script called " abc.js"?

  

  

  

  

To automatically open the console when a JavaScript error occurs which of the following is added to prefs.js?

  

  

  

  

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.