Introduction to Functions in JS


#1

Introduction to Functions in JS

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




#2

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


#3

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".


#4

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


#5

Thank you, you're superstar, it worked.


#6