I'm relatively new to ES6 Syntax. I had written a piece of code like follows:
const makeRange = (startTime, endTime) => {
return { startTime: startTime, endTime: endTime };
};
This worked fine, though I thought I shouldn't need the function braces ({ ...body ...}) for a one line return. The Following code:
const makeRange = (st, et) => { startTime: st, endTime: et };
As pointed by IntelliJ or Webstorm: "Expression Statement is not assignment or call".
How should I do it correctly(if it is valid)?