Development - Java Script - Variables

Variable can hold ________ value at a time

A.  Single

B.  Multiple

C.  Double

D.  None of these

View Answer  

Correct Answer :

Single



Explanation :
No Explanation available for this question

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

A.  One Variable Only

B.  More than One Variables

C.  One or more Variables

D.  None of these

View Answer  

Correct Answer :

One or more Variables



Explanation :
No Explanation available for this question

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

A.  var

B.  jvar

C.  obj

D.  None of these

View Answer  

Correct Answer :

var



Explanation :
No Explanation available for this question

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

A.  Special

B.  Punctual

C.  Mandetory

D.  None of these

View Answer  

Correct Answer :

Special



Explanation :
No Explanation available for this question

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

A.  Asterisk

B.  Dollar Sign

C.  Underscore

D.  Digit

View Answer  

Correct Answer :

Digit



Explanation :
No Explanation available for this question

Java Script Variable should be Case ___________.

A.  Sensitive

B.  Non Sensitive

C.  

D.  

View Answer  

Correct Answer :

Sensitive



Explanation :
No Explanation available for this question

var num; Above Statement is called as __________ Statement.

A.  Instantization

B.  Globalization

C.  Declaration

D.  Initialization

View Answer  

Correct Answer :

Declaration



Explanation :
No Explanation available for this question

var num=20; Above Statement is called as __________ Statement. Select all the appropriate options.

A.  Declaration/Initialization

B.  Globalization

C.  Instatiation

D.  None of these

View Answer  

Correct Answer :

Declaration/Initialization



Explanation :
No Explanation available for this question

Integer Variable is declared using following syntax in JavaScript.

A.  Integer num;  

B.  var num;  

C.  int num;  

D.  integer num;  

View Answer  

Correct Answer :
var num;

 



Explanation :
No Explanation available for this question

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

A.  3 4 2

B.  4 3 1

C.  1 2 3 4

D.  1 2 3

View Answer  

Correct Answer :

1 2 3



Explanation :
No Explanation available for this question

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

A.  VALUE

B.  ==

C.  EQUALS

D.  =

View Answer  

Correct Answer :

=



Explanation :
No Explanation available for this question

Multiple Declarations of variables are separated by ___________ symbol

A.  Semicolon

B.  Colon

C.  Comma

D.  Asterisk

View Answer  

Correct Answer :

Comma



Explanation :
No Explanation available for this question

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

A.  False

B.  True

C.  

D.  

View Answer  

Correct Answer :

True



Explanation :
No Explanation available for this question

var var1 = "Pritesh"; Above variable can store value of type.

A.  String

B.  Any Type

C.  Integer

D.  None of these

View Answer  

Correct Answer :

String



Explanation :
No Explanation available for this question

var x = 5; var y = 6; var z = 5 + 6; document.write(x + ""); document.write(y + ""); document.write(z + ""); Guess output of the following code.

A.  5 6 11

B.  5 6 56  

C.  5 6 10  

D.  Error

View Answer  

Correct Answer :
5
6
11





Explanation :
No Explanation available for this question

var x = "5"; var y = 6; var z = x + y; document.write(x + ""); document.write(y + ""); document.write(z + ""); Guess output of the following code.

A.  5 6 11

B.  5 6 10

C.  5 6 56

D.  None of These

View Answer  

Correct Answer :

5 6 56



Explanation :
No Explanation available for this question

Variable declared without a value will have the value ______________.Eg. var num;  

A.  0

B.  null

C.  undefined  

D.  None of these

View Answer  

Correct Answer :
undefined

 



Explanation :
No Explanation available for this question

var num1 = 1; var num2 = 1; var num3 = "1" + num1 + num2; document.write(num1 + ""); document.write(num2 + ""); document.write(num3 + ""); Guess output of the following code.

A.  1 1 3

B.  1 1 12

C.  1 1 111

D.  None of these

View Answer  

Correct Answer :

1 1 111



Explanation :
No Explanation available for this question

var x = 12.45; var y = 1; var z = '8' + x + y; document.write(z + ""); Value of Z is

A.  21.450

B.  21.451

C.  812.451

D.  813.451

View Answer  

Correct Answer :

812.451



Explanation :
No Explanation available for this question

var name = "John Doe"; var name = 123; document.write(name + ""); Is it possible to change the type of value after re-assignment.

A.  Yes !! It is possible.

B.  It can be possible if variable is assigned with interger value.

C.  No

D.  None of these

View Answer  

Correct Answer :

Yes !! It is possible.



Explanation :
No Explanation available for this question

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

A.  Yes

B.  No

C.  

D.  

View Answer  

Correct Answer :

No



Explanation :

We can skip "var" keyword but initialization is mandatory after skipping "var" keyword.


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

A.  Single/Double Quote

B.  Square Bracket

C.  None of these

D.  

View Answer  

Correct Answer :

Single/Double Quote



Explanation :
No Explanation available for this question

Non Initialized Variable have value "undefine", What value be printed in following case. var carname="Volvo"; var carname;  

A.  undefined

B.  Error

C.  Volvo

D.  null

View Answer  

Correct Answer :

Volvo



Explanation :

If you re-declare a JavaScript variable, it will not lose its value.


What will be the value of Variable - "num3" ? var num1; var num2 = 10; var num3 = num1 + num2;  

A.  10

B.  undefine10

C.  undefine

D.  None of these

View Answer  

Correct Answer :

undefine



Explanation :

Undefine + Any Value = Undefine


var x = 5; var y = 6; document.write((x + y) + ""); What will be the output of the following code ?

A.  56

B.  Error

C.  No Output

D.  11

View Answer  

Correct Answer :

11



Explanation :
No Explanation available for this question

Variable declared inside JavaScript Function will be called as ____________.

A.  Global Variables

B.  Local Variables

C.  

D.  

View Answer  

Correct Answer :

Global Variables



Explanation :
No Explanation available for this question

Vriables declared inside function are visible _______________.

A.  Inside the function in which it is declared

B.  to all the functions

C.  All the scripts inside save JS File

D.  None of these

View Answer  

Correct Answer :

Inside the function in which it is declared



Explanation :
No Explanation available for this question

Local Variables are destroyed after execution of function.

A.  False

B.  True

C.  

D.  

View Answer  

Correct Answer :

True



Explanation :
No Explanation available for this question

function message() { var name = "Pritesh"; alert(name); } Variable declared above is example of ___________ Variable.

A.  Global

B.  Local

C.  

D.  

View Answer  

Correct Answer :

Local



Explanation :
No Explanation available for this question

Variable declared outside JavaScript Function is called as _______________ .

A.  Global Variable

B.  Local Variable

C.  

D.  

View Answer  

Correct Answer :

Global Variable



Explanation :
No Explanation available for this question