How do I merge two arrays in JavaScript?
Arrays are one of the most used data types in any programming language. Learn how to merge two arrays in JavaScript with this short guide.
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.
Arrays are one of the most used data types in any programming language. Learn how to merge two arrays in JavaScript with this short guide.
Iterate over all own properties of an object, running a callback for each one.
Learn how you can check if a valid date object can be created from the given values.
Given a sorted array, find the correct index to insert a given value.
Create a generator function that finds all the indexes of a substring in a given string.
Using the Proxy object, we can create chainable dynamic getters for objects in JavaScript.
A stack is a linear data structure which follows a last in, first out (LIFO) order of operations.
Learn how to check if an array has one or more values matching the given function, and how to find the matching elements.
Ensure your HTML documents are properly structured by including these lines in your <head>
element.
Create an animated shadow box around the text when it is hovered.
Testing stateful React components is not difficult, but did you know there's a solution that doesn't involve testing state directly?
JavaScript's strict mode can make your code faster, cleaner and more secure.
Create an array of objects from an object and one of its array-valued properties.
Learn how to type check objects at runtime using the powerful Proxy object in JavaScript.
Given a predicate function, remove elements from an array that match the given condition.
Sort an array of numbers, using the insertion sort algorithm.
Learn how to create an inclusive array with numbers in a range, using a common step
difference.
Immutability is a fundamental concept you should be familiar with when learning functional programming.
Understand the basics of function composition, a fundamental concept in functional programming.
Learn how to create HTML elements in JavaScript, by abstracting the creation logic into a function.
Understand why JavaScript's built-in array sorting is not stable and how to implement a stable sorting algorithm.
Learn how CSS custom properties (CSS variables) work and what you can use them for in your code and designs.
Inform your users of invalid input by shaking the input field.
Create a horizontally or vertically scrollable container that will snap on elements when scrolling.