I am creating an object in JavaScript that holds employee information (name, rate, hours, gross pay). In order to calculate the gross, I need to multiply the hours times the rate. My teacher says I should be able to do it right inside my object, but it is not working. Here is my code:
const emp1 = {
name: "John Doe",
rate: 13.25,
hours: 20.25,
gross: rate * hours
};