Comments on: Fat Arrow Functions in JavaScript https://robcee.net/2013/fat-arrow-functions-in-javascript/ The enbloggening. Thu, 14 Apr 2016 12:18:55 +0000 hourly 1 https://wordpress.org/?v=6.9.4 By: Francis Kim https://robcee.net/2013/fat-arrow-functions-in-javascript/#comment-2508 Tue, 19 Jan 2016 01:15:33 +0000 http://robcee.net/?p=227#comment-2508 Ahead of time this post was

]]>
By: CoDEmanX https://robcee.net/2013/fat-arrow-functions-in-javascript/#comment-1785 Thu, 29 Jan 2015 18:29:27 +0000 http://robcee.net/?p=227#comment-1785 @rob: nice trick using “new”, but it can have side-effects. What about fn.hasOwnProperty(“prototype”) though? Apparently working in Firefox and iojs with –harmony_arraow_functions.

]]>
By: rob https://robcee.net/2013/fat-arrow-functions-in-javascript/#comment-1129 Sat, 23 Nov 2013 17:47:06 +0000 http://robcee.net/?p=227#comment-1129 In reply to Angelos Sphyris.

right you are! I’ve fixed it.

(we just proved Open Source works) 🙂

]]>
By: Angelos Sphyris https://robcee.net/2013/fat-arrow-functions-in-javascript/#comment-1128 Fri, 15 Nov 2013 19:12:56 +0000 http://robcee.net/?p=227#comment-1128 There is a slight error in your definition of fib

let fib = (n) => {
if (n <= 1) return 1;
return fib(n – 1) + fib(n – 2};
}

You need to enclose n-2 in parentheses not a left parenthesis and a right curly brace.

]]>
By: Jordan Harband (@ljharb) https://robcee.net/2013/fat-arrow-functions-in-javascript/#comment-1122 Tue, 08 Oct 2013 07:15:19 +0000 http://robcee.net/?p=227#comment-1122 I’ve written an npm module to detect if something is an arrow function or not – https://npmjs.org/package/is-arrow-function – it only works in Firefox at the moment, but will work in any runtime that supports arrow functions going forward!

]]>
By: rob https://robcee.net/2013/fat-arrow-functions-in-javascript/#comment-1121 Fri, 27 Sep 2013 13:33:49 +0000 http://robcee.net/?p=227#comment-1121 ix, no good reason. 🙂

]]>
By: ix https://robcee.net/2013/fat-arrow-functions-in-javascript/#comment-1120 Fri, 27 Sep 2013 08:32:28 +0000 http://robcee.net/?p=227#comment-1120 A side-question, but why are you not using event.target directly in your function? Why the extra temporary value?

]]>
By: Šime Vidas https://robcee.net/2013/fat-arrow-functions-in-javascript/#comment-1113 Mon, 23 Sep 2013 23:22:11 +0000 http://robcee.net/?p=227#comment-1113 My mistake, I meant this: ᐸscript type=”text/javascript;version=1.8″ᐳ

]]>
By: rob https://robcee.net/2013/fat-arrow-functions-in-javascript/#comment-1112 Mon, 23 Sep 2013 23:07:32 +0000 http://robcee.net/?p=227#comment-1112 In reply to Šime Vidas.

that’s really an issue with jsFiddle, not Firefox. If you run your example code directly in a Scratchpad or the Console it will work.

]]>
By: Šime Vidas https://robcee.net/2013/fat-arrow-functions-in-javascript/#comment-1111 Mon, 23 Sep 2013 23:05:10 +0000 http://robcee.net/?p=227#comment-1111 So, for the “let” statement to work, the code has to be placed in a script element with a type attribute that contains the “language” value, e.g. . On the other hand, arrow functions work in regular blocks. This should be noted in the article, since some people may try to test that code in their Firefox.

]]>