30 seconds of code provides a curated collection of short code snippets for all your development needs. Our collection spans many topics, ranging from simple coding problems to theoretical concepts and development techniques.
React, Components
Renders a checkbox list that uses a callback function to pass its selected value/values to the parent component.
JavaScript, Object
JavaScript provides a handful of native data structures that you can start using in your code right now.
JavaScript, Browser
The Event Loop is a source of confusion for many developers, but it's a fundamental piece of the JavaScript engine.
CSS, Animation
Creates a card that shifts on hover.
JavaScript, Algorithm
Groups the given data into k
clusters, using the k-means clustering algorithm.
JavaScript, Node
Create your own static file server with Node.js in just 70 lines of code.
React, Components
Renders a tabbed menu and view component.
CSS, Visual
Creates a list with floating headings for each section.
Learn the differences between JavaScript ES6 arrow functions and regular functions and how they affect event listener callbacks.
React, Render
Take a deeper dive into React's rendering process and understand how to make small yet powerful tweaks to optimize performance.
React, Components
Renders a textarea component with a word limit.
JavaScript, Object
Retrieves a set of properties indicated by the given selectors from an object.
JavaScript, Browser
Creates an object containing the parameters of the current URL.
JavaScript, Function
Boolean traps can cause readability and maintainability issues in your code. Learn what they are, how to spot and fix them in this article.
JavaScript, Function
Learn different ways to memoize function calls in JavaScript as well as when to use memoization to get the best performance results.