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

Java Script Variable should be Case ___________.

  

  

Adding String and Integer always results in _________.

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

What is the output.?

  

  

  

  

The “var” and “function” are

  

  

  

  

JavaScript is designed for following purpose 

  

  

  

  

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

  

  

  

  

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

  

  

  

  

var var1 = "Pritesh";

Above variable can store value of type.

  

  

  

  

Java Statement terminated by ______________ ,

  

  

  

  

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

  

  

The generalised syntax for a real number representation is

  

  

  

  

<script language="javascript">
function x()
{
document.write(2+5+"8");
}
</script> 

What is the output?

  

  

  

  

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

  

  

  

  

/* This is Simple Comment */

This is the example of ____________ Comment.

  

  

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

  

  

  

  

Which of the following is not considered a JavaScript operator?

  

new

 

  

this

 

  

delete

 

  

typeof

 

A statement block is a

  

  

  

  

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

  

  

  

  

var num=20;

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

  

  

  

  

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

  

  

  

  

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

What will be the output of the following code ?

  

  

  

  

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

var carname="Volvo"; 
var carname;

 

  

  

  

  

Variable name contain following type of characters -1. Alphabet2. Digits3. Underscore4. Special ChractersSelect the correct option.

  

  

  

  

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

  

  

  

  

"++" can operate only on ________________.

  

  

  

  

<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 development environment offers which standard construct for data validation

  

  

  

  

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

  

  

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>

 

  

  

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

  

  

  

  

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

  

  

  

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

  

  

  

  

JavaScript entities start with _______ and end with _________.

  

  

  

  

JavaScript Code can be called by using _________.

  

  

  

  

JavaScript is invented by ________.

  

  

  

  

JavaScript Code can be called by using _________.

  

  

  

  

The script tag must be placed in

  

  

  

  

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

  

  

  

  

Conditional Operator shown in the following example is _____________.

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

 

  

  

  

  

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

  

  

JavaScript is ideal to

  

  

  

  

Integer Variable is declared using following syntax in JavaScript.

  

Integer num;

 

  

var num;

 

  

int num;

 

  

integer num;

 

JavaScript is a _______________ language

  

  

  

  

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

  

  

  

  

JavaScript is also called as _____________.

  

  

  

  

Group of JavaScript Statements is called as _________.

  

  

  

  

Integer Variable + Character Variable + Undefined Variable = ______________ Value

  

  

  

  

______method evaluates a string of JavaScript code in the context of the specified object.

  

  

  

  

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

  

  

  

  

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

  

  

  

Which of the following is not a JSON type?

  

  

  

  

When an empty statement is encountered, a JavaScript interpreter

  

  

  

  

The output for the following code snippet would most appropriately be

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

 

  

  

  

  

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

  

  

  

  

Variable declared outside JavaScript Function is called as _______________ .

  

  

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

  

  

  

  

<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

  

  

  

  

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

  

  

  

  

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

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

 

  

  

  

  

Which of the following is not JavaScript Data Types?

  

  

  

  

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

  

  

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

  

  

  

  

How does JavaScript store dates in a date object? 

  

  

  

  

Which was the first browser to support JavaScript ?

  

  

  

  

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

  

  

  

Why JavaScript is called as Lightweight Programming Language ?

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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 is the correct JavaScript syntax to write "Hello World"?

  

  

  

  

Multiple Declarations of variables are separated by ___________ symbol

  

  

  

  

Comment Statement is _________________ type of statement.

  

  

  

  

What will be the output of the following script ?

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

 

  

  

  

  

Variable can hold ________ value at a time

  

  

  

  

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

  

  

  

  

To open a dialog box each time an error occurs, which of the following is added to prefs.js?

  

  

  

  

To enable data tainting, the end user sets the _________ environment variable.

  

  

  

  

What will be printed on the screen ? Var3 =100101010

  

  

  

  

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

 

  

  

  

  

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

  

  

  

  

Choose the client-side JavaScript object?

  

  

  

  

Is it possible to nest functions in JavaScript?

  

  

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

  

  

  

  

var num;

Above Statement is called as __________ Statement.

  

  

  

  

What does the tag do?

  

  

  

  

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>

 

  

  

  

  

The JavaScript exception is available to the Java code as an instance of __________

  

  

  

  

State the correct place of JS Code inside HTML -

  

  

  

  

Which of the following navigator object properties is the same in both   Netscape and IE?

  

  

  

  

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

  

  

  

  

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

  

  

  

  

What is mean by "this" keyword in javascript?

  

  

  

  

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

  

  

  

  

JS Comment can be used for following purposes

  

  

  

  

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

  

  

  

  

"===" operator is _______________.

  

  

  

  

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

  

  

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.