Observe the following JavaScript array declaration and answer the question:…
NVS Computer Science / IT Teacher Recruitment · Computer Science · 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" ]; ----------------------------------------
- A.
Both statements have exactly the same effect.
- B.
Both statements are different as they declare different types of variables.
- C.
Both statements are different as one is only declaring while other is declaring and initializing.
- D.
Both statements are different as they declare arrays of different sizes.
Attempted by 722 students.
Sign up free to check your answer
Sign up freeLoading lesson…