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

____________ is used to assign value to the variable.

  

  

  

  

JSON strings have to be in

  

  

  

JavaScript is _________ language.

  

  

  

  

var num;

Above Statement is called as __________ Statement.

  

  

  

  

A conditional expression is also called a

  

  

  

  

A ________ object is a reference to one of the classes in a Java package, such as netscape.javascript .

  

  

  

  

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

  

  

  

  

When a user views a page containing a JavaScript program, which machine actually executes the script?

  

  

  

  

Which of the following is not JavaScript Data Types?

  

  

  

  

The type of a variable that is volatile is

  

  

  

  

The statement a===b refers to

  

  

  

  

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

Variable declared above is example of ___________ Variable.

  

  

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

  

  

  

  

What is mean by "this" keyword in javascript?

  

  

  

  

Which of the following is not a compound assignment operator.

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

The output for the following code snippet would most appropriately be

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

 

  

  

  

  

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

  

  

  

  

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

  

  

JavaScript is interpreted by _________

  

  

  

  

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

  

  

  

  

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

  

  

  

  

How to create a Date object in JavaScript?

  

  

  

  

Multiple Declarations of variables are separated by ___________ symbol

  

  

  

  

What will be printed on the screen ? Var3 =100101010

  

  

  

  

Underscore can be used as first letter while declaring variable in JavaScript.

  

  

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

What is the output?

  

  

  

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

  

  

  

  

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 is not an logical operator ?

  

  

  

  

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

  

  

  

  

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

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

 

  

  

  

  

When a JavaScript object is sent to Java, the runtime engine creates a Java wrapper of type ___________

  

  

  

  

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

  

  

  

  

The “var” and “function” are

  

  

  

  

Why JavaScript is called as Lightweight Programming Language ?

  

  

  

  

Which best explains getSelection()?

  

  

  

  

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

  

  

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

What will be the Output of the above Code ?

  

  

  

  

Comment Statement is _________________ type of statement.

  

  

  

  

JavaScript Code can be called by using _________.

  

  

  

  

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

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

 

  

  

  

  

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

  

  

  

  

____________ is the tainted property of a window object.

  

  

  

  

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"

 

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

  

  

  

  

The _______ method of an Array object adds and/or removes elements from an array.

  

  

  

  

"===" operator is _______________.

  

  

  

  

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

  

  

  

  

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

  

  

  

Variable can hold ________ value at a time

  

  

  

  

The syntax of capture events method for document object is ______________

  

  

  

  

Which of the following is not a comparison operator ?

  

  

  

  

  

var var1 = "Pritesh";

Above variable can store value of type.

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

Integer Variable is declared using following syntax in JavaScript.

  

Integer num;

 

  

var num;

 

  

int num;

 

  

integer num;

 

var num=20;

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

  

  

  

  

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

  

  

  

  

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

  

  

JavaScript is designed for following purpose 

  

  

  

  

JavaScript is invented by ________.

  

  

  

  

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

  

  

  

  

JavaScript syntax to change the content of the following HTML code

  

  

  

  

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

  

  

<!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 script tag must be placed in

  

  

  

  

Scripting language are

  

  

  

Assignment Operators is following type of operator ______________.

  

  

  

  

State the correct place of JS Code inside HTML -

  

  

  

  

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

  

  

  

  

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

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

 

  

  

Group of JavaScript Statements is called as _________.

  

  

  

  

What will be the output of the following script ?

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

 

  

  

  

  

Executable single line of Script is called as _________________.

  

  

  

  

JavaScript Code is written inside file having extension __________.

  

  

  

  

JavaScript is Case Sensitive !!Say True or False

  

  

Java Statement terminated by ______________ ,

  

  

  

  

Microsoft Developed a compatible dialect of JavaScript called _____________.

  

  

  

  

A statement block is a

  

  

  

  

Which of the following event fires when the form element loses the focus: , , , , ?

  

  

  

  

Choose the server-side JavaScript object?

  

  

  

  

The JavaScript exception is available to the Java code as an instance 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) ?

  

  

  

  

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

  

  

Single Line Comment Starts with _________ Symbol.

  

  

  

  

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 enable data tainting, the end user sets the _________ environment variable.

  

  

  

  

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

  

  

  

  

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

  

  

  

  

Which of the following is correct about features of JavaScript?

  

  

  

  

Which of the following is not considered a JavaScript operator?

  

new

 

  

this

 

  

delete

 

  

typeof

 

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

What is the output?

  

  

  

  

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

  

  

  

  

When an empty statement is encountered, a JavaScript interpreter

  

  

  

  

Comments in JS are ignored by ____________.

  

  

  

  

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.