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

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

  

  

  

  

What will be the output of the following script ?

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

</html>

 

  

  

  

  

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

  

  

  

  

Comments in JS are ignored by ____________.

  

  

  

  

The statement a===b refers to

  

  

  

  

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

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

 

  

  

  

  

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

  

  

  

  

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

  

  

  

  

Java Script have following type of Comment(s) -

  

  

  

  

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

  

  

  

  

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

  

  

  

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

  

  

  

  

When you assign a text value to a variable, we put text value in the pair of _________.

  

  

  

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

  

  

  

  

____________ is used to assign value to the variable.

  

  

  

  

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

  

  

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

  

  

  

  

"++" can operate only on ________________.

  

  

  

  

JavaScript is designed for following purpose 

  

  

  

  

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

  

  

  

  

The main purpose of a “Live Wire” in NetScape is to

  

  

  

  

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

  

  

  

  

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

  

  

  

  

What will be the output of the following script ?

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

 

  

  

  

  

<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 of the following is considered as End of Single line comment ?

  

  

  

  

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

  

  

What will be printed on the screen ? Var3 =100101010

  

  

  

  

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

  

  

  

  

Which of the following is not a compound assignment operator.

  

  

  

  

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

  

  

  

  

JavaScript was invented at _______ Lab .

  

  

  

  

JavaScript is ideal to

  

  

  

  

JavaScript is ______ Side Scripting Language.

  

  

  

  

Local Variables are Destroyed as soon as ______________.

  

  

  

  

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

  

  

  

  

Why JavaScript is called as Lightweight Programming Language ?

  

  

  

  

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

  

  

  

  

Single Line Comment Starts with _________ Symbol.

  

  

  

  

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

  

  

  

  

Local Variables are destroyed after execution of function.

  

  

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

 

  

  

  

  

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?

  

  

  

  

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

  

  

  

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

  

  

  

  

JavaScript is Case Sensitive !!Say True or False

  

  

var num=20;

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

  

  

  

  

How to create a Date object in JavaScript?

  

  

  

  

Executable single line of Script is called as _________________.

  

  

  

  

What will be printed inside webpage ?

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

 

  

  

  

  

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

  

  

  

  

<!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 syntax of Eval is ________________

  

  

  

  

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

  

  

  

  

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

  

  

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

  

  

  

  

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

  

  

  

  

"++" is __________ type of operator.

  

  

  

  

State the correct place of JS Code inside HTML -

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

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

 

  

  

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

  

  

  

  

var var1 = "Pritesh";

Above variable can store value of type.

  

  

  

  

JavaScript is also called as _____________.

  

  

  

  

All modern browsers supports JS.

  

  

JS Comment can be used for following purposes

  

  

  

  

"===" operator is _______________.

  

  

  

  

JavaScript Code can be called by using _________.

  

  

  

  

Integer Variable + Character Variable + Undefined Variable = ______________ Value

  

  

  

  

Which of the following is not an logical operator ?

  

  

  

  

Microsoft Developed a compatible dialect of JavaScript called _____________.

  

  

  

  

Scripting language are

  

  

  

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

  

  

  

  

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"

 

A conditional expression is also called a

  

  

  

  

JavaScript entities start with _______ and end with _________.

  

  

  

  

JavaScript is interpreted by _________

  

  

  

  

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

  

  

The syntax of capture events method for document object is ______________

  

  

  

  

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

What is the output?

  

  

  

  

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

  

  

  

  

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

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

 

  

  

  

  

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

  

  

  

  

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

  

  

  

  

The generalised syntax for a real number representation is

  

  

  

  

The type of a variable that is volatile is

  

  

  

  

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

  

  

  

  

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

What will be the Output of the above Code ?

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

Variable can hold ________ value at a time

  

  

  

  

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

var num;

 

  

  

  

undefined

 

  

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

var carname="Volvo"; 
var carname;

 

  

  

  

  

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

  

  

  

  

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

  

  

  

  

Conditional Operator shown in the following example is _____________.

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

 

  

  

  

  

JavaScript Statements are executed 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.