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.
Learn how JavaScript's iterators work and how you can use them to level up your projects by understanding these short code examples.
JavaScript, Array · Sep 26, 2021
Take a deeper dive into React's rendering process and understand the role of the Context API and Redux in it.
React, Render · Jun 12, 2021
Renders a tree view of a JSON object or array with collapsible content.
React, Components · Nov 16, 2020
JavaScript provides a handful of native data structures that you can start using in your code right now.
JavaScript, Array · Sep 5, 2021
Renders an accordion menu with multiple collapsible content elements.
React, Components · Oct 13, 2021
Learn the differences between JavaScript ES6 arrow functions and regular functions and how they affect event listener callbacks.
JavaScript, Browser · Jun 12, 2021
There are many ways to iterate and transform array data in JavaScript. Learn how each one works and where you should use them.
JavaScript, Array · Jun 12, 2021
Renders a textarea component with a word limit.
React, Components · Oct 13, 2021
Create your own static file server with Node.js in just 70 lines of code.
JavaScript, Node · Jun 5, 2022
Creates a list with floating headings for each section.
CSS, Visual · Oct 11, 2021
Groups the given data into k
clusters, using the k-means clustering algorithm.
JavaScript, Algorithm · Dec 29, 2020
Learn different ways to memoize function calls in JavaScript as well as when to use memoization to get the best performance results.
JavaScript, Function · Nov 7, 2021
While these two properties are very similar, there are some key differences that you should be aware of.
JavaScript, Browser · Mar 19, 2023