Can anybody find what is wrong with this code..please help

Tell us what’s happening:

Your code so far

function uniteUnique(arr) {
   var num=[];
  for(var i=0;i<arr.length;i++){
    for(var j=0;j<arr[i].length;j++){

   return num;

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

Your browser information:

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

Link to the challenge:

The variable arr you’re working on catch just the first of the arrays^^
You can put a console.log(arr) after num=[] and read the console log in your browser ^^

but how to solve that…
in other online editor i tried similar code and it is working fine…

Look closely at argument(s) passed to the function.
You are not passing an array of arrays, you are passing a varying number of arrays separated by commas.

Either one of these links would be helpful in formulating a solution

1 Like