I just want to show the parameters being used. But I can see how this is confusing. One shouldn't return with a , for sure. But for those wondering why, see below for the output of this function:
constsomeFunc=(a,b)=>{returna,b}someFunc('a','b');// 'b'// It returns only the last argument
letfn=(a,b)=>a,bfn('a','b')// It won't be 'b' :)fn=(a,b)=>(a,b)fn('a','b')// Now it will.// Honorable mention:fn=((a,b)=>a,b)fn('a','b')// Uncaught TypeError: fn is not a function// (It's actually the `undefined` `b` declared at line 1:23)// How excellent is that?!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I just want to show the parameters being used. But I can see how this is confusing. One shouldn't return with a
,
for sure. But for those wondering why, see below for the output of this function:No, the real WUT is this: