I'm new to typescript, with a javascript background.
In (modern) js, the following is possible:
let {n,s} = {n:42, s:'test'};
console.log(n, s); // 42 test
In typescript I was assuming I could do the same, and indeed, according to the docs both declarations and assignments support destructuring. Except I can't seem to make it work:
let {n:number, s:string} = {n:42, s:'test'}; // All destructured elements are unused.
console.log(n, s); // Cannot find name 'n' (nor 's')
What did I miss ?