What does it mean to have an unexpected identifier?


#1

var main = function() {
$('.icon-menu').click(function()
    $('.menu').animate({
        left:'0px'
    }, 200);
    
    $('body').animate({
        left '285px'
    }, 200);
    });
    
    $('.icon-close').click(function() { 
    $('.menu').animate({
    left: '-285px'
}, 200);

$('body').animate({
    left: '0px'
}, 200);
    });

This is the code that I am using, it is "correct" but the menu still will not open or close and on the side it said I have an uncaught SyntaxError: unexpected identifier.


#2

Hi Charlie,

An unexpected identifier error usually means that you accidentally forgot to close something. I'm guessing in this case, you're missing a closing curly brace (}) to close main() before the $(document).ready(main) line :)
If that doesn't do it, could you let me know which exercise you're on so I can test the code easier please?
Thanks!