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

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





What will be the output of the following script ?

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






Which best explains getSelection()?





JavaScript is Case Sensitive !!Say True or False



Is this placement of JS code inside HTML Element is Error Free ?

<html><head><title>My Page</title>
<a href="javascript:myFunction();">Click here</a>
<script language="javascript" type="text/javascript">
function myFunction() {
    alert('Hello world');




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





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



Choose the server-side JavaScript object?





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





Why so JavaScript and Java have similar name?





State the correct place of JS Code inside HTML -





JavaScript was originally developed under the name _______.





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





Integer Variable is declared using following syntax in JavaScript.


Integer num;



var num;



int num;



integer num;


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





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

var num;








var var1 = "Pritesh";

Above variable can store value of type.





Adding String and Integer always results in _________.





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





Executable single line of Script is called as _________________.





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





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





Java Statement terminated by ______________ ,





The output for the following code snippet would most appropriately be

var a=5 , b=1
var obj = { a : 10 }






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





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





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





The statement a===b refers to





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





var num;

Above Statement is called as __________ Statement.





The generalised syntax for a real number representation is





Which of the following is not an logical operator ?





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





            var name = "John Doe";
            var name = 123;
            document.write(name + "<br>");

Is it possible to change the type of value after re-assignment.





"++" can operate only on ________________.





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





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



What are variables used for in JavaScript Programs?





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





The syntax of Eval is ________________





/* This is Simple Comment */

This is the example of ____________ Comment.



Which of the following is not a JSON type?





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




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





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

What are different Type of statements written inside above JS.






<script type="text/javascript">
// document.write("<h1>Heading</h1>");

Which of the statement will be neglected by Browser ?











The syntax of close method for document object is ______________





JS Comment can be used for following purposes





How to create a Date object in JavaScript?





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




Which of the following is not a compound assignment operator.





        <title>A Simple Page</title>
        <script language="JavaScript">
            var A = "Compile ",
                B = "Error";
            C = A + B;
            //  -->

What will be printed ?




<!DOCTYPE html>
            var x = "5";
            var y = 6;
            var z = x + y;
            document.write(x + "<br>");
            document.write(y + "<br>");
            document.write(z + "<br>");

Guess output of the following code.





Integer Variable + Character Variable + Undefined Variable = ______________ Value





How does JavaScript store dates in a date object? 





            var x = 12.45;
            var y = 1;
            var z = '8' + x + y;
            document.write(z + "<br>");

Value of Z is





Multiple Declarations of variables are separated by ___________ symbol





Scripting language are




JavaScript is designed for following purpose 





What will be printed inside webpage ?

var message="Hello JS";






The escape sequence ‘f’ stands for





Variable declared outside JavaScript Function is called as _______________ .



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





Why JavaScript is called as Lightweight Programming Language ?





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

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






What does the tag do?





The type of a variable that is volatile is





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

What will be the value of Variable 'output' ?





<script type="text/javascript">
    var name;
    name = "Pritesh";
<script type="text/javascript">

What will be the output of the following ?





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





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





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




JavaScript is _________ language.





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

<script type="text/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?





What is mean by "this" keyword in javascript?





Consider the following statements


In the above switch syntax, the expression is compared with the case labels using which of the following operator(s) ?





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

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






Which of the following is correct about features of JavaScript?





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





JSON name/value pair is written as





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





JavaScript is ideal to





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





Single Line Comment Starts with _________ Symbol.





A statement block is a





Which of the following is not JavaScript Data Types?





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

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






JavaScript code contain sequence of ___________.





Which is a more efficient code snippet ?

Code 1 :

for(var num=10;num>=1;num--)

Code 2 :

var num=10;






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





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





<script type="text/javascript">

What is the output.?





Conditional Operator shown in the following example is _____________.

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






The syntax of capture events method for document object is ______________





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




What will be printed on the screen ? Var3 =100101010





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"


JavaScript is invented by ________.





Comment Statement is _________________ type of statement.





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