Re:Fat arrow functions in Javascript
by armandososa on Friday September 20, 2013 @01:56PM
(#6419362)
this is a good start http://yehudakatz.com/2011/08/11/understanding-javascript-fu...
[ Parent
| on HN ]
Great link, that really clarified things for me (I think). The OP article uses this sample as something you can do with fat arrows. "Because the containing scope closes over the fat arrow function, you can do things like,"
let fib = (n) => {
if (n <= 1) return 1;
return fib(n - 1) + fib(n - 2};
}
I don't understand what this is showing. Wouldn't this code work the same way without fat arrows because there's no `this` being used anywhere?