DEV Community

Discussion on: How can I refactor this code snippet?

Collapse
 
bias profile image
Tobias Nickel

what about this?

const newReportPart = { ... this };

are there other props you on this that should not get added o the event? maybe you want to checkout underscore js with its pick or omit methods.

Collapse
 
yeahch profile image
ch

I see what you are meaning. but 'this' is Vue Component, and I want to pass only those parameters into newReportPart.
So I will take a look at pick or omit methods.
Thank you.