Skip to content

Add fail-safe to "Arrays" category methods to allow falsy values for array argument #24

@jdalton

Description

@jdalton

As issue #23 points out, sometimes it's nice to have array methods not error when they receive a falsy value for the required array argument.

The use case is something like

// should handle when `String#match` returns `null` without erroring
_.flatten(string.match(/regexp/))

So I would like to know if you all (/cc @kitcambridge @mathiasbynens) think it's worthwhile.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions