Map a JavaScript object to an array
Map an object to an object array, using the provided mapping function.
30 seconds of code contains a curated collection of code articles covering a wide range of development needs. The collection spans many topics, ranging from simple coding problems to theoretical concepts and development techniques.
Map an object to an object array, using the provided mapping function.
Learn the differences between the three most commonly used iteration methods in JavaScript, that often confuse beginners and veterans alike.
Learn how to compact an array or object in JavaScript using the Boolean
function and recursion.
Learn how to merge two arrays of objects, while combining objects based on a specified key.
Learn everything you need to know about Big-O notation with this handy cheatsheet.
Accessibility (a11y) can improve your website and attract new users. Learn how to get started with these 8 quick tips.
A toggle switch is little more than a checkbox with a custom appearance. This article shows you how to create one without using JavaScript.
Convert all the keys of an object to upper or lower case.
Learn how to use regular expressions to replace the last occurrence of a pattern in a JavaScript string.
Dynamically transition an element's height, based on its content.
Centering content with CSS might often feel difficult. Here are 4 easy ways you can do it.
I hand picked 25 of my favorite CSS gradients from uiGradients for your next design. Get them now!
Render a simple toggle component in React.
Roman numerals are often used for stylistic reasons, but converting an integer to a roman numeral can be a bit tricky.
Create a throttled function that only invokes the provided function at most once per the specified interval.
Learn how you can implement a delay function using setTimeout()
, promises and async
/await
.
Learn how to resolve promises one after another (sequentially) in JavaScript.
Ever wanted to use negative indices in JavaScript arrays? Here's a simple way to do it using a Proxy.
Easily convert an hsl()
color string to an array of values or an object with the values of each color.
SDBM is a simple, non-cryptographic hash function that can hash strings into whole numbers. Here's a JavaScript implementation.
Converts the output of any generator function to an array using the spread operator.
Find all the keys in a JavaScript object that match the given value.
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.
Learn how to change the lightness component of an hsl()
color string using JavaScript.