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, Logic
When working with state in your code, you often run into issues with maintaining complexity and readability. Oftentimes, these issues are easily fixable.
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 checkbox list that uses a callback function to pass its selected value/values to the parent component.
JavaScript, Function
Boolean traps can cause readabiltiy and maintainability issues in your code. Learn what they are, how to spot and fix them in this article.
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.
JavaScript, Function
Learn different ways to memoize function calls in JavaScript as well as when to use memoization to get the best performance results.
JavaScript, Function
Learn how to use JavaScript ES6 generators and iterators to iterate over ranges of numbers.
JavaScript, Algorithm
Groups the given data into k
clusters, using the k-means clustering algorithm.
JavaScript, Array
Asynchronously looping over arrays in JavaScript comes with a few caveats you should watch out for.
JavaScript, Function
Learn everything you need to know about higher-order functions with this short guide and level up your programming skills.
JavaScript, Array
Did you know you can define an iterator for any JavaScript value? This quick tip will show you how.
JavaScript, Object
A tree is a data structure consisting of a set of linked nodes representing a hierarchical tree structure.
React, Components
Renders a textarea component with a word limit.
React, Components
Renders a Modal component, controllable through events.