2 ms·
Regarding the example at the end of the post, how does it even make sense to allow an anonymous arrow function be a "paramater name" (yes!) of another anonymous
by egeozcan 11y ago
Regarding the example at the end of the post, how does it even make sense to allow an anonymous arrow function be a "paramater name" (yes!) of another anonymous function? I guess the empty object becomes a destructuring parameter that doesn't do anything but the function is confusing:
(
(
{},
{},
({},{})=>({},{})
)=>
(({},{})=>({},{}),{},{})
)({},{})
I can rewrite that to be more clear:
//(({},{})=>({},{}),{},{}) evaluates to {}
//({},{}) evaluates to {}
let fn = ({}, {}, ({},{})=>{}) => {};
fn({},{});
This is just a syntax error, I guess (hope)?
- SerpentJoe 11y agoIt is. You can try to translate the snippet using babel, it doesn't work unless you remove that parameter.