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 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!