What are promises in JavaScript? In which states can a promise be?
JavaScript's promises represent the eventual completion (or failure) of asynchronous operations and their resulting value.
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.
JavaScript's promises represent the eventual completion (or failure) of asynchronous operations and their resulting value.
JavaScript's arrow functions are seemingly the same as regular functions, but there are some important differences you need to know.
When it comes to immutability, JavaScript strings are often a source of confusion. Yet they're not as complicated as you might expect.
JavaScript uses callback functions quite a lot. From event listeners to asynchronous code, they're an invaluable tool you need to master.
Learn how to implement the singleton design pattern in JavaScript, using the Proxy object.
Learn how to create a custom responsive favicon that can adapt its color palette for dark mode with this quick guide.
Learn how you can leverage the Proxy object to use a JavaScript object the same way as you would use a regular array.
Learn how you can compare two arrays in JavaScript using various different 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 uses type coercion in Boolean contexts, resulting in truthy or falsy values. Get a hang of how it all works in this quick guide.
JavaScript provides a handful of native data structures that you can start using in your code right now.
A binary search tree is a hierarchical data structure of ordered nodes with at most two children each.
A binary tree is a hierarchical data structure of linked nodes with at most two children each.
A tree is a data structure consisting of a set of linked nodes representing a hierarchical tree structure.
A graph is a data structure consisting of a set of vertices connected by a set of edges.
A doubly linked list is a linear data structure where each element points both to the next and the previous one.
A linked list is a linear data structure where each element points to the next.
A stack is a linear data structure which follows a last in, first out (LIFO) order of operations.
A queue is a linear data structure which follows a first in, first out (FIFO) order of operations.
Did you know you can get the index of an array item in a JavaScript for...of loop? Learn how with this bite-sized tip.
Learn about Git's fast-forward mode and its benefits when merging branches, so you can decide if it's a good fit for you and your team.
Boolean traps can cause readability and maintainability issues in your code. Learn what they are, how to spot and fix them in this article.
Have you ever wanted to serialize an object but only include certain keys? Turns out JavaScript provides an easy way to do this!
JavaScript callbacks are especially tricky when you're not careful. Take a deeper dive into potential issues and how to avoid them.