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,402 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
12,869 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.