Answers for "typescript destructuring based on type fields"

3

typescript object destructuring

let { a, b }: { a: string; b: number } = o;
Posted by: Guest on October-14-2021
0

types for parameter destructuring

// How to you apply types to destructured parameters?
function args({ a, b }){
  ...
}

// TypeScript: types for parameter destructuring
function args({ a, b }:{ a: string, b: boolean }){
  ...
}

args({ a: "a", b: false });
Posted by: Guest on March-15-2022

Code answers related to "typescript destructuring based on type fields"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language