Using TypeScript, I am trying to figure out how to do array destructuring in the arguments list.
We can use object destructuring like so:
let foo = function({firstname, lastname}){...}
foo({
firstname: 'ralph',
lastname: 'lauren'
});
I am wondering if we can do the same thing with array destructuring, it would be very useful for me, something like:
let bar = function([desc, opts, fn]){...}
bar([
'yes',
{},
function(){}
]);
is it possible to do this with an array with TypeScript?