Challenge question in JavaScript | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 6

Challenge question in JavaScript

I think one of the challenge questions is mistaken. The question is let obj= { 1: 0, 0: 1 }; console.log(obj['1']); The result shows 1, but I think it should be 0, because on position '1' the value is 0.

27th Jun 2018, 6:59 PM
TheWhĀ”teCat šŸ‡§šŸ‡¬
TheWhĀ”teCat šŸ‡§šŸ‡¬ - avatar
2 Respostas
+ 3
Dāš½āš½āš½āš½7āƒ£7āƒ£7āƒ£ , No problem :) I have tried the given code in SoloLearn JS editor, and it outputs "0" as expected. Unfortunately, the provided answer is wrong :/
27th Jun 2018, 7:44 PM
777
777 - avatar
+ 5
I'm sorry the object was let obj, not object as I write it.
27th Jun 2018, 7:28 PM
TheWhĀ”teCat šŸ‡§šŸ‡¬
TheWhĀ”teCat šŸ‡§šŸ‡¬ - avatar