Open Mu7ammadAbed opened 3 years ago
Since you are not going to change the value of the variable (reassign) you should use const
const
https://github.com/GSG-G10/DevMonkeys-Ecommerce/blob/0b47b4ec1f48ee4bd3270d6c49b4f9ce9c2a47b9/js/logic.js#L23-L26
and you should write more descriptive variables/arguments names so you can write this function in es6 to become
const deleteItem = (products, item) => products.filter((elem) => elem.id !== item.id);
Eagle eye Muhammad, Mashallah!
Since you are not going to change the value of the variable (reassign) you should use
const
https://github.com/GSG-G10/DevMonkeys-Ecommerce/blob/0b47b4ec1f48ee4bd3270d6c49b4f9ce9c2a47b9/js/logic.js#L23-L26
and you should write more descriptive variables/arguments names so you can write this function in es6 to become