panzerdp / dmitripavlutin.com-comments

7 stars 0 forks source link

/object-rest-spread-properties-javascript/ #31

Open panzerdp opened 3 years ago

panzerdp commented 3 years ago

Written on 07/30/2017 12:20:25

URL: https://dmitripavlutin.com/object-rest-spread-properties-javascript/

panzerdp commented 3 years ago

Comment written by Jeff Keihl on 03/05/2018 20:01:42

Thanks for the clear explanation

panzerdp commented 3 years ago

Comment written by Dmitri Pavlutin on 03/06/2018 06:02:51

You're welcome.

panzerdp commented 3 years ago

Comment written by Steffen Kowalski on 12/10/2018 07:53:51

I join in @jeffkeihl:disqus . Clear and easy explained.

panzerdp commented 3 years ago

Comment written by radu belii on 01/12/2019 19:51:21

const users = {
firstName: 'Noidar',
lastName: 'ladorm',
city: 'Chisinau'
}

const { city, ...user} = users;
console.log(user);

One way if you want to extract data that you need from an object, with rest operator.

panzerdp commented 3 years ago

Comment written by Dmitri Pavlutin on 01/15/2019 12:56:20

Thanks!

panzerdp commented 3 years ago

Comment written by Dmitri Pavlutin on 01/15/2019 12:56:32

Yep, that would work.

panzerdp commented 3 years ago

Comment written by Edson Catugy on 01/26/2019 02:13:46

Useful information

panzerdp commented 3 years ago

Comment written by Dmitri Pavlutin on 07/05/2019 16:57:44

I'm glad you find it useful!

panzerdp commented 3 years ago

Comment written by saqib on 01/28/2020 04:52:46

awesome

sadric5 commented 3 years ago

Love it.