• Returns whether the given object is primitive

    Parameters

    • object: any

      the object to check

    Returns boolean

    whether the given object is primitive

    isPrimitive(undefined);    // true
    isPrimitive(true); // true
    isPrimitive('foobar'); // true
    isPrimitive({foo: 'bar'}); // false