The Intellisense of VSCode doesn’t work when deconstructing a object, it returns any
as the type, no matter what.
I tried:
/**
* @returns {{name:String,surname:String}}
*/
function Test(){
return {name:"John",surname:"Doe"};
}
const {name,surname} = Test(); // Intellisense shows "any" for both
I was expecting to get proper type information, in this case, string
.
New contributor
Kebs Studios is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.