Kaustubh
10 months ago

Merge Multiple Array Values

Posted 10 months ago by Kaustubh

I have 1 and more than 1 array and i have to merge them.

arr[0] => { view:true, edit:true, delete:false, add:false }
arr[1] => { view:false, edit:true, delete:false, add:false }
arr[2] => { view:true, edit:true, delete:true, add:false }

I need output like this

result = { view:true, edit:true, delete:true, add:false }

if any one of object have true value it should replace it to true from false

Thanks in advance

Please sign in or create an account to participate in this conversation.