I'm coming from Python and made a JavaScript function like this:
var totalPrice = function({price: price, taxRate: taxRate}){
return price + price * taxRate;
};
It works in Chrome, but I have three questions about it:
- What search terms should I have used to find out about this? I can't find this question asked elsewhere on SO, or anything about it in the MDN.
- Will this work in all browsers? Is it an ES2015 thing?
- Is this considered good or bad practice by any style guide you can reference? I'm also happy to hear gotchas, performance effects, or opinions.
Thanks!