es6 return object code example
Example: javascript return object in arrow function
const func = () => ({ foo: "bar" });
console.log(func()); // { foo: "bar" }
const func = () => ({ foo: "bar" });
console.log(func()); // { foo: "bar" }