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.
Easily remove duplicates from a JavaScript array using the built-in Set
object.
JavaScript, Array · Jun 12, 2021
Did you know you can get the index of an array item in a JavaScript for...of loop? Learn how with this bite-sized tip.
JavaScript, Array · Jul 25, 2021
Did you know you can define an iterator for any JavaScript value? This quick tip will show you how.
JavaScript, Array · Jun 12, 2021
When working with numeric arrays in JavaScript, you might need to find the minimum or maximum value. Here's a quick and easy way to do it.
JavaScript, Array · Nov 6, 2021
ESLint is a really useful tool, but sometimes it gets in the way. Learn how to refactor code to get rid of a common warning.
JavaScript, Array · Jun 12, 2021
Have you ever wanted to serialize an object but only include certain keys? Turns out JavaScript provides an easy way to do this!
JavaScript, Object · Jul 6, 2021
Learn how to resolve promises one after another (sequentially) in JavaScript.
JavaScript, Function · Oct 15, 2023
Ever wanted to get the value of an HTML input element as a number? Learn an easy way to do it with this handy trick.
JavaScript, Browser · Jun 12, 2021
Easily create a debounced function that returns a promise.
JavaScript, Function · Oct 13, 2023
A simple trick to remove one or more attributes from an HTML element.
JavaScript, Browser · Oct 21, 2023
Pretty-printing JSON objects in pretty easy and customizable in JavaScript. Here's the gist of it.
JavaScript, Object · Jul 30, 2022
Array destructuring can be leveraged in many different ways. Here's one of them.
JavaScript, Array · Aug 28, 2022
Find the n
minimum or maximum elements in a JavaScript array quickly and easily.
JavaScript, Math · Oct 5, 2023
Learn how to filter branches based on whether they contain a specific commit or not.
Git, Branch · May 25, 2023
Avoid the naive approach and use a more robust method to edit URL parameters in JavaScript.
JavaScript, String · Dec 7, 2022