Is it at all possible to run an equation inside an object? An example of what I'd like to achieve is:
var taxes = {
gst: '0.10',
};
var prices = {
first_key: '437.95',
total_key: parseFloat(prices.first_key * taxes.gst).toFixed(2),
.......
},
};
Or am I going to have to run it through as a function?
var prices = {
total_key: function() { return parseFloat(prices.first_key * taxes.gst).toFixed(2);}
}
If at all, is it possible to do it as the first option?
Cheers.