Diff Two Arrays Error

Diff Two Arrays Error
0.0 0

#1

Tell us what’s happening:
The requirements in the right column make no sense. This is suppose to return an array of the numbers that are unique to each array combined into a new array but the column in the right side has the return should be numbers with words and a “calf” and “diorte” or someting like thing?

Your code so far


function diffArray(arr1, arr2) {
  var newArr = [];
  // Same, same; but different.
  return newArr;
}

diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]);

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/diff-two-arrays


#2

You are supposed to create a generic function which will return an array of elements (numbers, letters, arrays, objects, or whatever is in the original arrays passed into the function) that is the symmetric difference of the two arrays.

There are multiple tests which will be subjected to your function (the right hand column contains these).

If you call the function as:

diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]);

it should return [4]

If you call the function as:

diffArray(["diorite", "andesite", "grass", "dirt", "pink wool", "dead shrub"], ["diorite", "andesite", "grass", "dirt", "dead shrub"]);

it should return [“pink wool”]