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.

  • isPowerOfTen

    JavaScript, Math

    Checks if the given number is a power of 10.

  • isSymbol

    JavaScript, Type

    Checks if the given argument is a symbol.

  • nthRoot

    JavaScript, Math

    Calculates the nth root of a given number.

  • approximatelyEqual

    JavaScript, Math

    Checks if two numbers are approximately equal to each other.

  • degreesToRads

    JavaScript, Math

    Converts an angle from degrees to radians.

  • isDivisible

    JavaScript, Math

    Checks if the first numeric argument is divisible by the second one.

  • isEven

    JavaScript, Math

    Checks if the given number is even.

  • isNil

    JavaScript, Type

    Checks if the specified value is null or undefined.

  • isNull

    JavaScript, Type

    Checks if the specified value is null.

  • isOdd

    JavaScript, Math

    Checks if the given number is odd.

  • isPowerOfTwo

    JavaScript, Math

    Checks if the given number is a power of 2.

  • isUndefined

    JavaScript, Type

    Checks if the specified value is undefined.

  • radsToDegrees

    JavaScript, Math

    Converts an angle from radians to degrees.

  • toSafeInteger

    JavaScript, Math

    Converts a value to a safe integer.