I am working on this bug and I keep getting the following error –
TypeError: this.parts[1].reviewMoment is not a function
I am using jQuery and backbone. Unfortunately, I’m not really familiar with JS and not sure why this line broke.
define([
"jquery",
"underscore",
], function($, _) {
reviewMoment: function(place) {
this.collection.bind("add", _.once(_.bind(this.triggerReview, this)));
this.collection.addMomentByPlace(place);
},
triggerReview: function() {
this.parts[(this.matchView ? 2 : 1)].reviewMoment();
if(this.matchView) {
this.matchView.search.close();
}
}
});
});
Why is reviewMoment not considered a function?
Thanks.
It’s not a function because you’re not actually creating an object literal
{}in which you can use theidentifier:propertynotation. To create valid function definitions place a return statement with an object literal around your functions: