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 DOM Scripting By Example Improving the Application Code Refactor 2: Readable Branching Logic

Kaya Jackson
seal-mask
.a{fill-rule:evenodd;}techdegree
Kaya Jackson
Full Stack JavaScript Techdegree Student 8,734 Points

Console error

I saw the same question posted a couple times but I still don't get it. The 'action' variable isn't a part of the object so I don't understand how it works in the instructor code video. I made sure my code matches and I can't find any errors. Here's github: https://github.com/amanij7/rsvp-app/blob/master/app.js

2 Answers

Steven Parker
Steven Parker
231,271 Points

The "action" holds the name of the method that will be called. In the video, the method names match the button labels, but here the methods have lower-case names and the labels use title case so they don't match.

The actual names are not important but they must be exactly the same in the class and on the button.