5 Tips for Writing Cleaner Code
Prevent unnecessary nesting
Too much nesting can make the code harder to read and more prone to errors, so we can return early to avoid excessive nesting.
// Bad
function deleteItem(item) {
if (item != null) {
console.log('Deleting item');
...
shineve.hashnode.dev3 min read