create and return object in javascript example Example: how to return an object in javascript function func() { return { name: "Name", age: 34 }; }