Function isDate

  • Returns true if the given object is a Date. Otherwise, returns false.

    const util = require('util');

    util.isDate(new Date());
    // Returns: true
    util.isDate(Date());
    // false (without 'new' returns a String)
    util.isDate({});
    // Returns: false

    Deprecated

    Since v4.0.0 - Use types.isDate instead.

    Parameters

    • object: unknown

    Returns object is Date

  • Returns true if the given object is a Date. Otherwise, returns false.

    const util = require('util');

    util.isDate(new Date());
    // Returns: true
    util.isDate(Date());
    // false (without 'new' returns a String)
    util.isDate({});
    // Returns: false

    Deprecated

    Since v4.0.0 - Use types.isDate instead.

    Parameters

    • object: unknown

    Returns object is Date

Generated using TypeDoc