Function typeIs

  • Returns true if typeof(value) == type, otherwise false. This function allows for type narrowing. i.e.

    // v is unknown
    if (typeIs(v, "Vector3")) {
    // v is a Vector3
    print(v.X, v.Y, v.Z);
    }

    Type Parameters

    Parameters

    • value: any
    • type: T

    Returns value is CheckableTypes[T]