Skip to content

Default value needed if key not exist inside some object in array of objects #64

Open
@ghost

Description

Hi, I am looking for a solution where my data is
[ { "name": "rahul", "email": "[email protected]" }, { "name": "amit", "email": "[email protected]" }, { "email": "[email protected]" }, { "name": "brijesh", "email": "[email protected]" } ]
Note: name key is missing in third object

query: [].name

result:
[ "rahul", "amit", "brijesh" ]

expected result:
[ "rahul", "amit", "", "brijesh" ]

please help

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions