Remove unwanted properties from a JavaScript with ES6 spread operator

Tomasz Łakomy
InstructorTomasz Łakomy

Share this video with your friends

Send Tweet

In this lesson we are going to learn how to remove unwanted properties from a JavaScript object following an example of an object containing sensitive data (such as password and bankBalance) and removing this kind of data from it.

To achieve that we are going to use two ES6 features: destructuring an object and the spread operator.

tsvika
tsvika
~ 10 months ago

wouldn't this cause memory leaks for unused vars?