Observe the following JavaScript array declaration and answer the question:…

2017

Observe the following JavaScript array declaration and answer the question: Statement 1 ItemName = new Array ( "Chromebook" , "IPad" , "Mobile" ); Statement 2 ItemName = [ "Chromebook" , "IPad" , "Mobile" ]; ---------------------------------------- ​

  1. A.

    Both statements have exactly the same effect.

  2. B.

    Both statements are different as they declare different types of variables.

  3. C.

    Both statements are different as one is only declaring while other is declaring and initializing.

  4. D.

    Both statements are different as they declare arrays of different sizes.

Attempted by 366 students.

Show answer & explanation

Correct answer: A

Correct Answer: A. Both statements have exactly the same effect. ---------------------------------------- ​

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Up Lt Grade Assistant Teacher 2025