Play Home Contribute GitHub Join Us Discourse Staff Members GitHub Contribution Guides Team

MIssing semicolon error


I’m playing GREED. I was trying to implement 2 methods, one to filter gems by range and another to filter them by bounty. Both methods had the same problem, “missing semicolon”. I followed the example on the guide for creating methods, and I’m not used to Javascript, so if anyone could help me and point out if it this is my own mistake or it’s a genuine bug, I’d be pleased.

this.getUnitsInRange = function(units, range) {
return units.filter(function(unit){
    return (this.distance(unit) < range); //the error is pointed in this line
    }, this);}


I’m sorry, I’ve already figured out my mistake.