I know I can do this:
function (value: [boolean, string]) {
const [boolValue, stringValue] = value;
// make use of boolValue and stringValue
}
But am I able to do something like this?
// doesn't work
function ([boolValue: boolean, stringValue: string]) {
// make use of boolValue and stringValue
}
Ok I figured it out, might as well post as an answer. This works:
function ([boolValue, stringValue]: [boolean, string]) {
// make use of boolValue and stringValue
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With