Development - Java Script - Variables 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

Local Variables are destroyed after execution of function.

  

  

Variable declared inside JavaScript Function will be called as ____________.

  

  

Multiple Declarations of variables are separated by ___________ symbol

  

  

  

  

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

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

 

  

  

  

  

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

  

  

  

  

Variable declared outside JavaScript Function is called as _______________ .

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

var carname="Volvo"; 
var carname;

 

  

  

  

  

Integer Variable is declared using following syntax in JavaScript.

  

Integer num;

 

  

var num;

 

  

int num;

 

  

integer num;

 

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

var num;

 

  

  

  

undefined

 

  

Is it necessary to use "var" keyword while declaring variable.

  

  

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

  

  

  

  

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

  

  

  

  

var num=20;

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

  

  

  

  

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

  

  

  

<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

  

  

  

  

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

  

  

  

  

Local Variables are Destroyed as soon as ______________.

  

  

  

  

Variable can hold ________ value at a time

  

  

  

  

var var1 = "Pritesh";

Above variable can store value of type.

  

  

  

  

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

Variable declared above is example of ___________ Variable.

  

  

Java Script Variable should be Case ___________.

  

  

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

  

  

  

  

var num;

Above Statement is called as __________ Statement.

  

  

  

  

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

  

  

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

  

  

  

  

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

  

  

  

  

Vriables declared inside function are visible _______________.

  

  

  

  

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.