Skip to content

$append should return an array, not a singleton when either arg1 or arg2 is undefined. #311

Open
@wnm3

Description

@wnm3

$append claims to return an array. However, as coded, if the first argument is undefined, it returns arg2 without making it an array. Try a.b.c~>$append("abc") which returns "abc" rather than ["abc"]. Likewise, "abc"~>$append(a.b.c) returns "abc" rather than ["abc"]. You can also do $append("abc",a.b.c) or $append("abc",a.b.c). $append(a.b.c,a.b.c) returns null (no match) but one could argue it should return [].

When a function claims to return an array, shouldn't the result always be an array?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions