Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript JavaScript Foundations Arrays Getting and Setting

Michael Randall
PLUS
Michael Randall
Courses Plus Student 10,643 Points

I'm not sure that I understand what they are asking in this question?

Are they asking us to replace the third element in the array, which is "fix", with the string "thirdElementInTheArray"? No matter what I do, I get the incorrect answer. I'm assuming that they want us to specify the array name and in the brackets specify the index of the element that is the third element. So, my_array[2] = "thirdElementInTheArray"; replace the string at the 3 position in the array.

Has anyone solved this and can they clarify?

1 Answer

J. M.
J. M.
15,389 Points

It's not asking you to replace "fix" with "thirdElementInTheArray", it's asking you to set the variable thirdElementInTheArray to the actual third element.

All you need to do is change the number inside the bracket from 3 to 2.

Michael Randall
Michael Randall
Courses Plus Student 10,643 Points

Hi Thank you for that. After asking the question I went back and looked at it again and then realized what they were asking. Basically it was a test to see if we could use index values to match up with the correct element in the array.

Again, thanks for the quick response.