DEV Community

Cover image for Three dots "..." in JS - Spread and Rest explained

Three dots "..." in JS - Spread and Rest explained

Kedar Kodgire on March 25, 2020

Three dots ... is one of the favorites for JavaScript developers as it has a lot of use cases which makes their life easier. Well, you can see thi...
Collapse
 
roniemeque profile image
Ronie

Cool! Another great example for rest usage is when you want to create a new object based on a existing one while excluding specific properties:
const {password, ...userWithoutPassword} = user;