More of an exercise in ‘what-if’, I was wondering if the following was possible:
output = convert(1200).from('mm').to('inches')
where ‘from’ and ‘to’ are functions (or properties) of ‘convert’ as opposed to the more standard:
output = convert(1200, 'mm', 'inches')
or:
output = convert(value = 1200, from = 'mm', to = 'inches')
addendum: I’m guessing the closest would be:
output = convert({ value: 1200, from: 'mm', to: 'inches' });
function convert({ value, from, to } = {}){
// ...do stuff here...
}