JavaScript: SyntaxError: missing ) after argument list

I am getting the error:

SyntaxError: missing ) after argument list

With this javascript:

var nav = document.getElementsByClassName('nav-coll');
for (var i = 0; i < button.length; i++) {
    nav[i].addEventListener('click',function(){
            console.log('haha');
        }
    }, false);
};

What does this error mean?

Leave a Comment