es6 get function 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" }