Tips & Tricks
React.memo(): Custom Comparison Logic
When using React.memo() to optimize functional components in React, you may want to implement custom comparison logic if the component receives complex objects or arrays as props. By default, React.memo() performs a shallow comparison of props, which means it only compares the props at the top level and does not perform a deep comparison of…
Naming CheatSheet
Naming things in programming can be a challenging task, but it’s a crucial part of writing clear and maintainable code. This CheatSheet aims to simplify the process and provide practical tips that can be applied to any programming language. Throughout the article, we’ll use JavaScript examples to demonstrate these concepts in action. English Language Use…
Removing Falsy Values from JavaScript Arrays
In JavaScript, falsy values such as false, 0, ” (an empty string), null, undefined, and NaN can cause unexpected behavior when working with arrays. In this post, we will explore how to use the filter() method to remove falsy values from arrays, and provide examples of how this technique can be used to clean up…