-
It's just a function parameter :)
The_
is just the single input parameter. You can omit the parens, if there is only a single parameter. But you can think about it aswut = _unusedParameter => 42
Btwboo = () => 42
is the same.To add more obscurity to it, you can do something like
foo = _ => 42
without the curly braces.
Which again is just the equivalent offunction˙foo(){ return 42 }
:) The42
after the arrow is an implicit return, if your lambda doesn't have the curly braces{ }
Wed 2020.02.05
I've not seen this syntax used with arrow functions:
= _=>
Finally found what might be a suggestion to an answer:
Anyone able to shed some light within Espruino, and generally with Javascript usage? Thanks