What is the Event Loop in JavaScript?
The Event Loop is a source of confusion for many developers, but it's a fundamental piece of the JavaScript engine.
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.
The Event Loop is a source of confusion for many developers, but it's a fundamental piece of the JavaScript engine.
Learn how to detect undefined object properties in JavaScript the correct way.
Pretty-printing JSON objects in pretty easy and customizable in JavaScript. Here's the gist of it.
Let's have a look at how to check if a string contains a substring in JavaScript.
You've probably come across the double negation operator (!!) before, but do you know what it does?
Ever wanted to iterate over nested iterables in JavaScript? Here's how.
Adding a key-value pair to a JavaScript object is straightforward, yet there are multiple ways available to do so.
Here's a quick tip on how to compare and sort arrays of strings, ignoring case and accents.
Have you ever tried appending elements to an array in JavaScript? Here's a primer on all the available options.
If you need to replace all occurrences of a string in JavaScript, you have a couple of options.
Did you know there are multiple ways to remove an element from an array? Let's take a look.
Randomness and pure functions don't seem to go hand in hand. But where there's a will, there's a way.
Avoid unnecessary re-runs by using primitive dependencies in your React effect.
Create your own static file server with Node.js in just 70 lines of code.
Learn how to create HTML elements in JavaScript, by abstracting the creation logic into a function.
Many beginners get stuck in tutorial hell without even realizing. Here are 4 simple ways to escape tutorial hell and get back to learning.
The CSS selectors used to target the root element of an HTML share some similarities, but they also have some differences.
Closures are used frequently, yet often misunderstood. Understanding them in depth is crucial to be able to write clean, maintainable code.
Aborting a fetch request in JavaScript is a common problem. Here's how to handle it correctly.
JavaScript's spread operator is a very versatile tool. Here are some simple ways to use it.
Freezing objects is not the only way to prevent mutations. Learn how you can leverage the Proxy object to your advantage.
Nesting elements with rounded borders can look very wrong if not done correctly. Here's a quick tip on how to do it right.
Testing your code is important, but mocking can be tricky at times. Here's a quick guide on how to mock global object methods in Jest.
Are you performing a lot of array operations? Maybe element removal is a performance bottleneck you can avoid.