While playing with the Developer Console in Firefox, I tried doing this:
var a = b => c => c;
and then this:
a(1)
I expected the result to be function()
(corresponding to c => c
), but this was displayed instead:
function a/<()
What is the meaning of this expression? It clearly isn't legal Javascript, since neither /
nor <
are valid characters for a function name.
The same happens using the regular notation for functions, i.e. var a = function(b) { return function(c) { return c; } }
.
Here is a screenshot:
Edit: I tried the following
var a = b => c => d => d;
a(1)
and the result is
a/</<()
which makes me think it's some kind of lesser-known shorthand notation.
Commenters on the relative issue on bugzilla have pointed out that it's part of a naming convention for anonymous function.
a/b
- innerb
ofvar a = function() { var b = function() {}; }
a<
- flagsa
"contributor" or basically some helper function which contributes to the function nameda
by being anonymous inside it.
So a/<()
means that there is an anonymous function was declared in the body of a
.