Daw588
1
var people = [
{name: "test1", picture: ""},
{name: "test2", picture: ""},
{name: "test3", picture: ""},
{name: "test4", picture: ""},
{name: "test5", picture: ""},
{name: "test6", picture: ""}
];
console.log(people[0].name);
It should return test1
. But instead it gives me undefined
. I don’t understand why.
people[0].name
isn’t undefined
, but return value of console.log
is.
1 Like
Daw588
3
How I can fix that? Cause it doesn’t seem right to me.
@Daw588 can you post your whole code? As from your code, I guess it should return test1
.
Daw588
5
that’s my full code
Whatever I try to console.log()
it will always return undefined
.
That’s really weird. I ran the same code and got
test1
<- undefined
on Mozilla and Chrome. Maybe the site on which you’re console logging might have hacked with console
class.
Daw588
7
I tried this on discord.com
, google.com
, and support.glitch.com
. Same results. NVM. I was on “errors” section instead of “user-messages”.
1 Like