Nitin Agarwal Nitin Agarwal - 6 months ago 60
Javascript Question

Javascript ES6 Difference between ()=>() and ()=>{}

I have seen a code something like while learning React

const LinkCell = ({rowIndex, data, col, ...props}) => (
<Cell {...props}>
<a href="#">{data.getObjectAt(rowIndex)[col]}</a>

Also, so far I thought that in ES6 function shorthand is

let sum = (a, b)=>{
return a + b;

How the first one is different from the second one ?


with the ()=> () syntax imagine if there was an implicit return statment e.g. () => {return ()}