Can an equation be executed inside an object? For instance:
var taxes = {
gst: '0.10',
};
var prices = {
first_key: '437.95',
total_key: parseFloat(prices.first_key * taxes.gst).toFixed(2),
.......
},
};
Or do I need to utilize a function?
var prices = {
total_key: function() { return parseFloat(prices.first_key * taxes.gst).toFixed(2);}
}
If possible, can it be done as shown in the first example?
Cheers.