I've got following code:

```
setStatus = false;
_.map(array, function (element) {
    return {
    name: element.type,
    status: element.status
    })  

```

I'd like to optionally set 'status' parameter. F.e when setStatus variable is false then elements in mapped collection would be containing 'name' parameter only;

How can I handle this?