Array.length: Why 2 instead of 3? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Array.length: Why 2 instead of 3?

I found this quiz question: var arr = []; arr[0] = "x"; arr[1] = "y"; arr.key = "c"; console.log(arr.length) // 2

6th Jul 2020, 8:59 PM
Prof. Dr. ZoltƔn Vass
2 Respostas
+ 1
Martin Taylor Thank you! Iā€™ve changed the code as you suggested : (null) {"0":"x","1":"y","key":"c"} https://code.sololearn.com/WDfnN326rhKu/?ref=app
6th Jul 2020, 9:39 PM
Prof. Dr. ZoltƔn Vass
+ 1
Martin Taylor Thank you so much for correcting me.
7th Jul 2020, 11:00 AM
Sachin Kumar Shaw
Sachin Kumar Shaw - avatar