JavaScript Snippets

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.

  • JavaScript's built-in Boolean function can be very useful for truth-checking data among other things. Learn how to use it and level up your code today.

  • One of the most commonly asked JavaScript interview questions is about hoisting. It's also a concept that might require some getting used to, so read our guide to learn more.

  • JavaScript ES2020 introduced optional chaining and nullish coalescing among other features. Learn everything you need to know with this quick guide.

  • JavaScript developers often get confused by JavaScript's variables and scope. Here's a quick guide to understanding and remembering everything related to these concepts.

  • equals

    JavaScript, Object

    Performs a deep comparison between two values to determine if they are equivalent.

  • isDuplexStream

    JavaScript, Node

    Checks if the given argument is a duplex (readable and writable) stream.

  • isWritableStream

    JavaScript, Node

    Checks if the given argument is a writable stream.

  • isEmpty

    JavaScript, Type

    Checks if the a value is an empty object/collection, has no enumerable properties or is any type that is not considered a collection.

  • isPromiseLike

    JavaScript, Type

    Checks if an object looks like a Promise.

  • isReadableStream

    JavaScript, Node

    Checks if the given argument is a readable stream.

  • Learn all you need to know about the differences between JavaScript's double equals and triple equals operators.

  • isAsyncFunction

    JavaScript, Type

    Checks if the given argument is an async function.

  • isGeneratorFunction

    JavaScript, Type

    Checks if the given argument is a generator function.

  • isArrayLike

    JavaScript, Type

    Checks if the provided argument is array-like (i.e. is iterable).

  • isStream

    JavaScript, Node

    Checks if the given argument is a stream.