cancel
Showing results for 
Search instead for 
Did you mean: 

Ignore the null in array

manohar
Contributor

hi there, I have to map an array object as in the screenshot below.

image

I have 2 records in that array. one is coming in as null and the other has value as in the below screenshot. how can I ignore the one that’s null and map the one with value? as it looks like its taking the second record, that’s null

image

image

Thanks
Manohar

1 REPLY 1

Supratim
Contributor III

Hi @manohar ,
Try this option-
$response.entity[‘order-header’][‘order-lines’].filter((val,index)=> val != null)