http://robcee.net/2013/fat-arrow-functions-in-javascript/ - checked my syntax here
I am trying to use it in my code but it gives this error
Uncaught SyntaxError: Unexpected token >
at this line
google.maps.event.addListener(this.map, "rightclick", (event) => {
in this code
google.maps.event.addListener(this.map, "rightclick", (event) => {
this.showContextMenu(event);
});
If i replace the fat arrow function by this
var self = this;
google.maps.event.addListener(this.map, "rightclick", self.showContextMenu);
It works fine. but, the I do not have access to the variables that i want to have. hence, to fix the scoping issue I used fat arrow function. Does anyone know why it aint working in my code. To me the syntax looks right for fat arrow function