I have a question about decalaration of JS function. I declared a function as follows:
create=(name,agfdf,gender)=>({name,a,gender});
(name,agfdf,gender)=>({name,a,gender})
the argument passed is agfdf, but the output does not contain agfdf. The function acutally works:
input: create("P",3,"M")
output: {name: "P", a: 3.6, gender: "M"}
a: 3.6
gender: "M"
name: "P"
__proto__: Object
I do not understand how this would work. Could anyone of you explain? Thanks a lot!