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

"++" can operate only on ________________.

  

  

  

  

Local Variables are destroyed after execution of function.

  

  

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

  

  

  

  

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

  

  

  

  

Integer Variable is declared using following syntax in JavaScript.

  

Integer num;

 

  

var num;

 

  

int num;

 

  

integer num;

 

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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

Which of the following is not considered a JavaScript operator?

  

new

 

  

this

 

  

delete

 

  

typeof

 

State the correct place of JS Code inside HTML -

  

  

  

  

Integer Variable + Character Variable + Undefined Variable = ______________ Value

  

  

  

  

Which of the following is not considered as an error 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?

  

  

  

  

JavaScript is also called as _____________.

  

  

  

  

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

  

  

  

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

  

  

  

  

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

 

JS Comment can be used for following purposes

  

  

  

  

JavaScript is interpreted by _________

  

  

  

  

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

  

  

  

  

Which of the following is not a compound assignment operator.

  

  

  

  

JavaScript is a _______________ language

  

  

  

  

What does the tag do?

  

  

  

  

var num;

Above Statement is called as __________ Statement.

  

  

  

  

Local Variables are Destroyed as soon 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

  

  

  

  

One of the special features of an interpreter in reference with the for loop is that ___________

  

  

  

  

When an empty statement is encountered, a JavaScript interpreter

  

  

  

  

Variable declared outside JavaScript Function is called as _______________ .

  

  

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

  

  

  

  

JavaScript is _________ language.

  

  

  

  

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

  

  

  

  

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

  

  

  

  

It is not necessary to write Semicolon at the end of JS 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>

 

  

  

  

  

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

  

  

  

  

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

What is the output?

  

  

  

  

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

  

  

  

  

What will be the output of the following script ?

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

 

  

  

  

  

Java Script have following type of Comment(s) -

  

  

  

  

What is mean by "this" keyword in javascript?

  

  

  

  

JavaScript is Case Sensitive !!Say True or False

  

  

<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 name;
    name = "Pritesh";
</script>
<script type="text/javascript">
    document.write(name);
</script>

What will be the output of the following ?

  

  

  

  

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

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

 

  

  

  

  

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

Variable declared above is example of ___________ Variable.

  

  

Which of the following is not JavaScript Data Types?

  

  

  

  

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

var num;

 

  

  

  

undefined

 

  

JSON name/value pair is written as

  

  

  

  

var var1 = "Pritesh";

Above variable can store value of type.

  

  

  

  

Why so JavaScript and Java have similar name?

  

  

  

  

JavaScript syntax to change the content of the following HTML code

  

  

  

  

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

  

  

  

  

Multiple JS statements are written inside pair of ________ to form a statement block.

  

  

  

  

Vriables declared inside function are visible _______________.

  

  

  

  

Which of the following is not a comparison operator ?

  

  

  

  

  

The development environment offers which standard construct for data validation

  

  

  

  

Variable can hold ________ value at a time

  

  

  

  

A statement block is a

  

  

  

  

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.

  

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

____________ is used to assign value to the variable.

  

  

  

  

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

  

  

  

  

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

  

  

  

  

The syntax of capture events method for document object is ______________

  

  

  

  

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

  

  

  

  

Adding String and Integer always results in _________.

  

  

  

  

How does JavaScript store dates in a date object? 

  

  

  

  

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

  

  

  

  

Which types of image maps can be used with JavaScript?

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

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

 

  

  

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

  

  

  

  

Which of the following is not an logical operator ?

  

  

  

  

Conditional Operator shown in the following example is _____________.

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

 

  

  

  

  

The syntax of close method for document object is ______________

  

  

  

  

The generalised syntax for a real number representation is

  

  

  

  

Java Script Variable should be Case ___________.

  

  

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

  

  

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

  

  

  

What will be printed inside webpage ?

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

 

  

  

  

  

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

  

  

Scripting language are

  

  

  

The syntax of Eval is ________________

  

  

  

  

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

  

  

  

  

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

  

  

  

  

Executable single line of Script is called as _________________.

  

  

  

  

JavaScript was invented at _______ Lab .

  

  

  

  

JavaScript is invented by ________.

  

  

  

  

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

  

  

  

  

var num=20;

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

  

  

  

  

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

  

  

  

  

The statement a===b refers to

  

  

  

  

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

What is the output?

  

  

  

Which was the first browser to support JavaScript ?

  

  

  

  

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.