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 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,403 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.