Reputation: 661
For some reason I can't seem to find where by syntax error would be in this Lodash function. Does anyone know where I'm going wrong here?
const classes = _.filter(state.classes, class => {
return class.date === moment()
});
Here is the error I'm seeing (using React Native):
The particular position it is referring to (64:49) is after the class
on the first line.
Upvotes: 2
Views: 147
Reputation: 816462
class
is a keyword. Keywords cannot be used as variable names. Use a different name for the parameter.
Upvotes: 5
Reputation: 1606
Try to use a different name for your function parameter, class
is a reserved keyword :D
Upvotes: 1