clear-af.js
    Preparing search index...

    Function isType

    • Function

      Check if the variable is of the chosen type

      Parameters

      • value: unknown

        The variable to check

      • type: string

        The type you want

      Returns boolean

      True if the value is of the chosen type, false otherwise

      isType("hello", "string");    // true
      isType(42, "number"); // true
      isType([], "object"); // true
      isType("42", "number"); // false