Answers for "compare two arrays diff"

14

javascript difference between two arrays

let difference = arr1.filter(x => !arr2.includes(x));
Posted by: Guest on April-03-2020
4

php find differences between two arrays

<?php
$array1 = array("a" => "green", "red", "blue", "red");
$array2 = array("b" => "green", "yellow", "red");
$result = array_diff($array1, $array2);

print_r($result);
?>

Array
(
    [1] => blue
)
Posted by: Guest on May-07-2020

Code answers related to "compare two arrays diff"

Code answers related to "Javascript"

Browse Popular Code Answers by Language