Currently, I am trying to set properties within a JavaScript class:
class BookingReports extends ReportsInterface{
var categoryID;
constructor() {
super();
}
init(CatID)
{
this.categoryID=CatID;
}
}
However, when attempting to do so, JavaScript is rejecting the variable and throwing an error stating "unexpected identifier".
https://i.sstatic.net/zCbbg.png
I am struggling to pinpoint what exactly is causing this syntax error. Could it be related to inheritance or the super
keyword? I've even tried using binding within the entire declaration, but unfortunately, that approach is not resolving the issue.