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

The type of a variable that is volatile is

  

  

  

  

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

var num;

 

  

  

  

undefined

 

  

____________ is the tainted property of a window object.

  

  

  

  

Assignment Operators is following type of operator ______________.

  

  

  

  

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

  

  

  

  

"++" can operate only on ________________.

  

  

  

  

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

  

  

  

  

Integer Variable + Character Variable + Undefined Variable = ______________ Value

  

  

  

  

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.

  

  

  

  

  

When an empty statement is encountered, a JavaScript interpreter

  

  

  

  

Variable declared inside JavaScript Function will be called as ____________.

  

  

var num;

Above Statement is called as __________ Statement.

  

  

  

  

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

  

  

  

  

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

What will be the Output of the above Code ?

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

Microsoft Developed a compatible dialect of JavaScript called _____________.

  

  

  

  

var var1 = "Pritesh";

Above variable can store value of type.

  

  

  

  

Which of the following function of Array object applies a function simultaneously against two values of the array (from right-to-left) as to reduce it to a single value?

  

  

  

  

Which of the following is not considered a JavaScript operator?

  

new

 

  

this

 

  

delete

 

  

typeof

 

JavaScript is Case Sensitive !!Say True or False

  

  

Local Variables are Destroyed as soon as ______________.

  

  

  

  

Consider the following statements

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

In the above code snippet, what happens?

  

  

  

  

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

  

  

  

  

The generalised syntax for a real number representation is

  

  

  

  

The statement a===b refers to

  

  

  

  

Java Script have following type of Comment(s) -

  

  

  

  

Which of the following is not a comparison operator ?

  

  

  

  

  

What will be the output of the following script ?

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

</html>

 

  

  

  

  

Adding String and Integer always results in _________.

  

  

  

  

What is mean by "this" keyword in javascript?

  

  

  

  

JavaScript Code can be called by using _________.

  

  

  

  

var num=20;

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

  

  

  

  

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

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

 

  

  

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

  

  

  

  

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

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

 

  

  

  

  

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

  

  

  

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

What will be the value of Variable 'output' ?

  

  

  

  

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

  

  

  

  

JavaScript is a _______________ language

  

  

  

  

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

var carname="Volvo"; 
var carname;

 

  

  

  

  

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

 

  

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

  

  

  

  

Choose the client-side JavaScript object?

  

  

  

  

Scripting language are

  

  

  

JavaScript is invented by ________.

  

  

  

  

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

  

  

  

JavaScript is also called as _____________.

  

  

  

  

"===" operator is _______________.

  

  

  

  

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

  

  

  

  

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

  

  

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

  

  

  

  

Which of the following function of String object causes a string to be italic, as if it were in an tag?

  

  

  

  

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

  

  

  

The escape sequence ‘f’ stands for

  

  

  

  

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

  

  

  

  

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

  

  

  

  

The syntax of close method for document object is ______________

  

  

  

  

The syntax of capture events method for document object is ______________

  

  

  

  

JavaScript Statements are executed by ________ .

  

  

  

  

What will be printed inside webpage ?

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

 

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

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

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

 

  

  

The output for the following code snippet would most appropriately be

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

 

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

Java Statement terminated by ______________ ,

  

  

  

  

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

  

  

  

  

Executable single line of Script is called as _________________.

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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 Code can be called by using _________.

  

  

  

  

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

  

  

Single Line Comment Starts with _________ Symbol.

  

  

  

  

JavaScript is ideal to

  

  

  

  

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

  

  

  

  

Which of the following attribute can hold the JavaScript version?

  

  

  

  

Which was the first browser to support JavaScript ?

  

  

  

  

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>

 

  

  

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

  

  

Comments in JS are ignored by ____________.

  

  

  

  

JavaScript is ______ Side Scripting Language.

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

____________ is used to assign value to the variable.

  

  

  

  

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

What is the output?

  

  

  

  

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

  

  

  

  

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

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

 

  

  

  

  

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

  

  

  

  

Local Variables are destroyed after execution of function.

  

  

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

  

  

  

  

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.