Finding ways to improve and optimize your code takes a lot of time, research and energy. Level up your coding skills one step at a time with this collection of quick tips and tricks.
Document.elementFromPoint() to easily get the element at a specific point on the page.
Learn how to execute a function for each element of an array, starting from the last one.
In React components, you might need to conditionally apply a
className. Learn how to handle empty values correctly using this handy tip.
React, Components · Nov 7, 2021
Turns out the Proxy object is not extensible, but there's a way around its limitations.
Here's a quick tip on how to compare and sort arrays of strings, ignoring case and accents.
Dynamically adding object properties can be pretty slow in some cases. Here's how to optimize it.
There are many ways to create empty links, some more appropriate than others. Learn how to best handle empty links with this quick tip.
currentColor CSS keyword is a nifty alternative to custom properties for simple use cases.
CSS, Visual · Nov 30, 2022
Create a debounced function that waits a certain amount of time before invoking the provided function again.
Mutable default arguments can trip up Python beginners and veterans alike. Here's a quick workaround to deal with them.
Python, Function · Feb 27, 2022
Avoid unnecessary re-runs by using primitive dependencies in your React effect.
React, Hooks · Jun 12, 2022
Scroll listeners can easily become a performance bottleneck for your web application. Here's how to fix that.
Learn how to sort a Python dictionary list using a tuple key.
Python, List · Jan 4, 2023