I'm currently using react and I have noticed that the behaviour may change depending on how a callback is used. (Not sure if this is called notation). To illustrate my question, let's use Array.map()
.
Array.map(el=> return el.name);
Array.map((el)=> return el.name);
Array.map((el)=> {return el.name});
Array.map(el=> {return el.name});
Are these four cases correct? What is the expected behaviour of each of them? Is there any that can be used "safely" always so it does bring up grammar errors?