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.
Testing stateful React components is not difficult, but did you know there's a solution that doesn't involve testing state directly?
SEO is a very relevant topics that most developers are inexperienced in. Here are 4 actionable SEO tips you can implement today.
Learn the basics of the destructuring assignment syntax in JavaScript ES6 and improve your code with this easy guide.
Learn and understand closures, a core concept in JavaScript programming, and level up your code.
JavaScript ES6 introduced us to powerful new features, such as the spread and rest syntax. Learn all you need to know in this quick guide.
JavaScript ES2020 introduced optional chaining and nullish coalescing. Learn everything you need to know with this quick guide.
Learn how to quickly write code to sort JavaScript arrays with this handy one-liner.
Regular expressions are a very useful tool. Save this cheatsheet for when you need to look up their syntax and speed up your development.
Naming conventions make code easier to read and understand. Learn how to name your variables in JavaScript with this handy guide.
JavaScript provides two methods for encoding characters to URL-safe strings. Do you know when to use each one?
Flexbox allows you to create fluid layouts easily. If you are constantly looking up how it works, this handy cheatsheet is all you need.
Recursive code tends to be inefficient or in need of optimization. Learn a couple of tricks we use to speed up our recursive functions.
A JavaScript promise's then
and finally
methods seem very similar. But there are a few important differences you need to keep in mind.
Learn the difference between cookies, local storage and session storage and start using the correct option for your needs.
There are many ways to create empty links, some more appropriate than others. Learn how to best handle empty links with this quick tip.
Learn everything you need to know about the conditional (ternary) operator and how to use it in JavaScript.
Increase your JavaScript code's performance when working with the DOM by leveraging this simple trick.
JavaScript's instanceof
operator can't be used with primitive values, but there are a some tricks that you can leverage to your advantage.
Iteration in JavaScript can be done a handfuld of ways, most often using array methods, but sometimes a for
loop is the best option.
The constructor is a crucial part of any JavaScript class, which is why you might want to take a closer look at what they return.
Ever wanted to create your own jquery-like query selector shorthand? Here's how!
Learn how to level up your regular expressions game, with features such as backreferences, lookaheads and named groups.
You can use a lot of different techniques to empty an array in JavaScript. See which ones best suits your needs with this quick guide.