-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
DuplicateAn existing issue was already createdAn existing issue was already created
Description
I've just noticed this problem:
var myBooks = [
{title: 'Sherlock Holmes'},
{title: 'Moby Dick'}
];
var bookTitles = myBooks.map(({title}) => title); // Boo! no type information; title is `any`
So if I use parameter destructuring I lose the type information which is kinda sad.
I can work around it like this:
var bookTitles = myBooks.map(b => {
const { title } = b;
return title;
});
or this:
var bookTitles = myBooks.map(b => b.title);
But ideally I shouldn't need to.
Metadata
Metadata
Assignees
Labels
DuplicateAn existing issue was already createdAn existing issue was already created