I'm relatively new to AJAX and I don't understand how do arrow function works with promise
well the syntax I'm familiar with the following:
functionThatReturnsAPromise()
.then(function(data) {
// Do somthing with data
})
.catch(function(err) {
// Do something with error
});
but I have come accross this code which based on an arrow function, I really don't understand it:
getActivityInformations(event) {
return this.service.getEntityRep(a).then(list => {
const myList = list ? list.length : 0;
// some code
});
}