Examveda
Examveda

Consider the below given syntax
book[datatype]=assignment_value;
In the above syntax, the datatype within the square brackets must be

A. An integer

B. A String

C. An object

D. None of the mentioned

Answer: Option B

Solution(By Examveda Team)

When using square bracket notation, the expression inside the square brackets must evaluate to a sting or a value that can be converted to a string.

This Question Belongs to Javascript >> Basic And Variables

Join The Discussion

Comments ( 1 )

  1. Ravi Kumar
    Ravi Kumar :
    6 years ago

    I think i should be integer as i got the logic
    var n = [10,05,25,100,2,79];
    n[0]
    10
    [0] = 0 is an integer not string


    can you correct it

Related Questions on Basic and Variables