cjmling / findings

Notes on stuff i finds worth keeping for quick reference later on.
2 stars 0 forks source link

Destructure as to new variable #318

Open cjmling opened 2 years ago

cjmling commented 2 years ago
const myFunc= ({ chandu: firstName, lastName }: { chandu: string, lastName: string } ) => {
   // firstName have value = asdf
   // lastName have value = asdfasdf
}

myFunc({chandu: 'asdf', lastName: 'asfdasfd' });

SEO : destructure as variable typescript