Snippets

Inspired by Josh W. Comeau's blog, this is a collection of my code snippets that you can look at for inspiration or copy/paste at will.

NameDescriptionCategory
indexByKey()Description: A function to turn an array of objects into an object, indexed by the chosen keyCategory: JavaScript
randomRGB()Description: Function to generate random rgb() stringsCategory: JavaScript
inflect()Description: Function used to choose the correct form of a word, singular or pluralCategory: JavaScript
usePrevious()Description: Hook for storing and getting a previous valueCategory: React Hooks
compose() & pipe()Description: Functions for composing other functionsCategory: JavaScript

Let's talk some more about JavaScript, React, and software engineering.

I write a newsletter to share my thoughts and the projects I'm working on. I would love for you to join the conversation. You can unsubscribe at any time.

Data Structures and Algorithms Logo
Data Structures and Algorithms

Check out my courses!

Liked the post? You might like my video courses, too. Click the button to view this course or go to Courses for more information.
View on egghead.io