SyntaxError: Unexpected token else

I wonder why I keep getting error when I use else if conditionals, Please examine the code below and tell me what’s wrong with it.

var numOfPeople = 32

if (numOfPeople > 32) {console.log(‘Too many people,’)};

else if (numOfPeople< 32) {console.log(‘Too many people’)}

else {console.log(‘We are right on track’)}

Perhaps you should copy the lines of code and run on your system. Notice the syntaxerror message? Now delete the else in line 3 and notice that the code doesn’t run?

Please assist

You have an extra semi-colon after one of your curly braces. JavaScript thinks the else if is the beginning of something new and it’s getting confused why else is there at all.

You fixed it. Thanks a lot.