Introduction to Functions in JS


Introduction to Functions in JS

I keep getting this error, and I don't see any problems, someone please help me. Thank you.


keywords (if/else) are case sensitive. if you like, you could name a variable If, if is a keyword


When I use small caps(if & else) I get another error, saying identifier expected, only when I use Big caps does the code work. yet I still get that syntaxError that "{ expected".


normally when you have a function, you use curly brackets to mark start and end of function:

var example = function(){


the curly brackets are missing in your case. If you need more help, post an updated version of your code


Thank you, you're superstar, it worked.