intercellular/cell

ES6 functions

Closed this issue · 1 comments

Ok not sure probably my bad not understanding js but I was messing with a copypasta of the orly tut, and found that if I replace

$update: function() {...}

with

$update: ()=>{...}

that this borken something and this (and this._params) referred to the window rather than the thing IYGMD,

The fat arrow syntax works differently than regular functions. More specifically the whole point of fat arrow functions is to lock the context inside the function.

So this is exactly what's supposed to happen. It's not related to the library, it's just how JavaScript works.

Going to close since it's not a bug and not related to the library (It's about how ES6 works). But feel free to reply and ask if you have further questions. Thanks!