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 trialNathan evans
3,775 Pointswhat is the error; ReferenceError: Left side of assignment is not a reference.
i dont know what it means or whats wrong
var guestList = ['Sandra', 'Omar', 'Magnus', 'Becky'];
guestList.push() = ["Tony", "Geen",];
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JavaScript Loops</title>
</head>
<body>
<script src="script.js"></script>
</body>
</html>
Dehn Hunsworth
7,189 Pointsand there is an extra comma in the array your adding to original
2 Answers
Dehn Hunsworth
7,189 PointsIts because of the = the array your adding to the guestList should be inside the ()
guestList.push(["name1", "name2"]);
Dehn Hunsworth
7,189 PointsI believe not a reference is kinda like saying its not a variable, since its a method your calling on a variable.
Christian Higgins
15,758 PointsRewatch the previous video Adding Data to Arrays from about the 2:00 to about the 3:20 mark. The items you want to push to your array will go inside the parentheses of the push method. You also don't need to add the brackets.
Nathan evans
3,775 PointsNathan evans
3,775 Pointsive tried changing the " " , 's into ' ' ,