Function toBool

  • Return the the boolean value of the first non-null element. Example:

    const opts = { flag: true };
    const value = util.toBool(opts.foo, opts.flag, false); // returns true

    Parameters

    • Rest ...boolDefaults: (undefined | null | boolean)[]

    Returns boolean