Open Mu7ammadAbed opened 3 years ago
For consistency purposes, you should stick to one way of writing variables names, functions names, CSS classes and write in one version of ECMA script es5 or es6
https://github.com/GSG-G10/DevMonkeys-Ecommerce/blob/0b47b4ec1f48ee4bd3270d6c49b4f9ce9c2a47b9/js/logic.js#L18-L20
and since your function does only one job which is returning something In one line, you can write this function like this
const filterByCategory = (name) => products.filter((item) => item.category === name );
For consistency purposes, you should stick to one way of writing variables names, functions names, CSS classes and write in one version of ECMA script es5 or es6
https://github.com/GSG-G10/DevMonkeys-Ecommerce/blob/0b47b4ec1f48ee4bd3270d6c49b4f9ce9c2a47b9/js/logic.js#L18-L20
and since your function does only one job which is returning something In one line, you can write this function like this