Boolean traps and how to avoid them
Boolean traps can cause readability and maintainability issues in your code. Learn what they are, how to spot and fix them in this article.
The JavaScript snippet collection contains a wide variety of ES6 helper functions. It includes helpers for dealing with primitives, arrays and objects, as well as algorithms, DOM manipulation functions and Node.js utilities.
Boolean traps can cause readability and maintainability issues in your code. Learn what they are, how to spot and fix them in this article.
Learn all you need to know to effectively and efficiently typecheck values in JavaScript.
JavaScript doesn't have a built-in way to check if a value is blank, but it's easy to create one.
JavaScript's Boolean function can be used for truth-checking data among other things. Learn how to use it and level up your code today.
Hoisting comes up a lot during JavaScript interviews. It's a concept that may require some getting used to, so read our guide to learn more.
JavaScript ES2020 introduced optional chaining and nullish coalescing. Learn everything you need to know with this quick guide.
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.
Learn how to type check objects at runtime using the powerful Proxy object in JavaScript.
Performs a deep comparison between two values to determine if they are equivalent.
Learn how to type check for different types of streams in Node.js.
Checks if the a value is an empty object/collection, has no enumerable properties or is any type that is not considered a collection.
JavaScript's instanceof
operator can't be used with primitive values, but there are a some tricks that you can leverage to your advantage.
Use a simple JavaScript trick to validate a serialized JSON object.
Make sure to use the correct method when checking if a JavaScript object is an array.
JavaScript variables can be declared a handful of ways. However, understanding their differences can drastically change the way you code.
Have you ever tried to convert the string representation of a boolean to an actual boolean value? Here's a simple way to do it.
JavaScript developers often get confused by JavaScript's variables and scope. Here's a quick guide to understanding these concepts.
Checks if the provided value is an object created by the Object constructor.
You've probably come across the double negation operator (!!
) before, but do you know what it does?
JavaScript has three different empty states for variables. Learn their differences and how you can check for each one.
Learn all you need to know about the differences between JavaScript's double equals and triple equals operators.
Numeric separators are a somewhat lesser-known JavaScript syntactic sugar that can make working with large constants a lot easier.
JavaScript distinguishes expressions and statements. Learn their differences in this short article.
When it comes to immutability, JavaScript strings are often a source of confusion. Yet they're not as complicated as you might expect.