diff --git a/README.md b/README.md index a51252cc..4c1b233f 100644 --- a/README.md +++ b/README.md @@ -602,11 +602,7 @@ const addItemToCart = (cart, item) => { **Good:** ```javascript const addItemToCart = (cart, item) => { - const c = Object.assign({}, cart); - - c.push({ item, date: Date.now() }); - - return c; + return [...cart, { item, date : Date.now() }]; }; ```