This can be simplified: 

```js
$(event.currentTarget).toggleClass('favorited', data.result.favorited);
```