2

Not sure why the console.log() in my snippet return different value of the browser developer console :

enter image description here

You could see that it return an empty array [] instead of filled one like console below.

The snippet belong to the Following Post.

6
  • 1
    I would guess it's because your console is also showing the non-numeric properties, but the SO console is skipping them and just showing numeric properties from the array. Commented Jun 30, 2016 at 17:39
  • What should be done to reproduce that? Commented Jun 30, 2016 at 17:48
  • @nicael Fill the fields and hit the "print" span. Commented Jun 30, 2016 at 21:07
  • You shouldn't be using an array. The snippet console is just behaving in a sane way, like Firefox console. Blame Chrome console for being weird. Commented Sep 8, 2016 at 2:53
  • You shouldn't be using an array Why @Oriol ? Commented Sep 8, 2016 at 8:17
  • @ZakariaAcharki Because the properties of arrays are supposed to be array indices. You should use a normal object instead. Commented Sep 8, 2016 at 16:06

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.