Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript Interactive Web Pages with JavaScript Selecting Elements and Adding Events with JavaScript Perform: Selecting Elements

Reid Larson
Reid Larson
12,711 Points

why is everything coming up as undefined?

I usually write all the code along with the videos to have it stick in my mind. When I started getting errors i looked through all my code and it was fine. Then i even copied from workspace to sublime and still the same thing. First I get an Uncaught SyntaxError: Unexpected token '{' on my add task function which doesn't make sense. Then i try looking at taskInput and i'm getting Uncaught ReferenceError: taskInput is not defined

this is driving me crazy.

David Clausen
David Clausen
11,403 Points

Pasting your code will be the first step in helping as we have no clue without the code that is messing up.

paste it in between:

```Javascript
//Paste Code between here
```

Thanks

2 Answers

Raymond Wach
Raymond Wach
7,961 Points

As David Clausen said in his comment, it's difficult to debug without seeing the code. My guess would be that you are missing something like a semicolon or a closing brace or parenthesis above the line with the SyntaxError. Typically, errors along the lines of "Unexpected token" really indicate an error in the code before that point, but the parser isn't smart enough to backtrack and figure out what could be missing so it just reports the thing it wasn't expecting to see.

Reid Larson
Reid Larson
12,711 Points

I was actually able to figure it out! Thanks!