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 Treehouse Club - MASH MASH - JavaScript Handle Submission and Event Handler Functions

why function does not work

function does not work if i give it a name of pizza

is it a predefined keyword

3 Answers

Peter Lawless
Peter Lawless
24,404 Points

No, to my knowledge pizza is not a reserved keyword in JavaScript. You should be able to write a function called pizza and it should work so long as you call it by that name everywhere you reference it in your code.

Can you show me you code? Like what Peter Lawless said, "pizza" actually isn't a reserved keyword. But to solve the error, we also need to see your code. Also, don't forgot when your pasting in code, don't forget to check to check out the Markdown Cheatsheet (look below an answer box and above the Post Answer button) to your code will be formatted correctly! :)

Armand van Alphen
Armand van Alphen
16,969 Points

Pizza isn't a reserved word did you write your function like this?

function pizza() { //your code }

note if this doesn't help press F12 to check the developer console on windows your can see where your code breaks there.