N shortcut error


#1

Can someone tell me what I'm doing wrong?? Thanks!!

var main = function() {
    $('.article').click(function() {
        $('.article').removeClass('current');
        $('.description').hide();
        $(this).addClass('current');
        $(this).children('.description').show();
    });
    $(document).keypress(function(event) {
        if (event.which === 111) {
            $('.current').children('.description').toggle();
        else if (event.which === 110) {
          var currentArticle = $('.current');
          var nextArticle = currentArticle.next();
          
          currentArticle.removeClass('current');
          nextArticle.addClass('current');
        }
    });
    
};
$(document).ready(main);

#2

Hi Caroline,

You've forgotten to close your if statement before your else if statement :)

Hint: how to close an if statement

Since you open an if statement with an opening curly brace ({), you close it with a closing one (}). Example if statement:

    // ↓ if the condition is true, the code inside the curly braces gets run  
if (/* condition */) { // ← opens the if statement
  // do stuff
} // ← close the if statement


#3

Thank you! That worked.