Help please....jukujhjhi

Tell us what’s happening:
Hi

Why have I got var myArray = [1]? And when I print it with console.log it returns 1 as well which I thought would have returned the second value 60?

Your code so far


// Setup
var myArray = [50,60,70];

// Only change code below this line
var myArray =[1]
var myData = myArray[0]
console.log(myArray)

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36 Edg/88.0.705.56.

Challenge: Access Array Data with Indexes

Link to the challenge:

You seem to have accidentally put gibberish in your post title.

Right here you set your array to be [1], so this is why it is set to [1]. I’m not sure what you would like that line to do, but I think it should be removed.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.