Java Array course, creating an empty array

https://www.codecademy.com/courses/learn-java/lessons/learn-java-arrays/exercises/creating-an-empty-array?action=resume_content_item

I had no problems with the first part of the exercise, but the second part was harder for me because of the placement.

Initially I put newArticle = favoriteArticle[favoriteIndex], yet CodeAcademy said it was incorrect, but when the two were switched around, all of a sudden it is correct? Why ?

Assignment is from right to left, so data structure[index] = item being assigned.

favoriteArticles[favoriteIndex] = newArticle;
4 Likes