The N shortcut 2: unexpected token else


I'm getting an error that says, "Syntax error: unexpected token else"
and also this one, "Oops, try again. It looks like the n key isn't moving to the next article. Remember to remove the 'current' class from currentArticle and place it on nextArticle."

var main = function () {
        if (event.which === 111) {
        else if (event.which === 110) {
            var currentArticle = $('.current');
            var nextArticle =;


The reason you have unexpected token else is because you're placing semicolons after your if statements, which breaks up the conditional statements.


Thank you so much! Such a simple fix


This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.