Open Fuco1 opened 6 years ago
That's because there's no way to know from a function expression if an arrow function should contain a return statement or not since both are valid.
Regarding the formatting issue, this is something which can be improved.
Wouldn't it be possible to not include the return if not necessary then? I think most people would prefer such a style (we even have some lint checks that complain when there are unnecessary returns).
I'm not sure how feasible it is and I've only been working with javascript for a short time, so please excuse any ignorance.
Granted, this is not the most pressing issue there is.
I have code like this
When I toggle to function function it returns
I would expect
When I call it again it gives
which is not what I started with.