<commit_before>function unite(arr1, arr2, arr3) {
  answer = [];

  for(var j = 0; j < arguments.length; j++) {
    for(var i = 0; i < arguments[j].length; i++) {
      if(answer.indexOf(arguments[j][i]) === -1) {
        answer.push(arguments[j][i]);
      }
    }
  }


  return answer;
}

unite([1, 2, 3], [5, 2, 1, 4], [2, 1]);
<commit_msg>a shorter solution to Sorted Union<commit_after>function unite(arr1, arr2, arr3) {
  answer = [];
  for(var j = 0; j < arguments.length; j++) {
    for(var i = 0; i < arguments[j].length; i++) {
      if(answer.indexOf(arguments[j][i]) === -1) {
        answer.push(arguments[j][i]);
      }
    }
  }
  return answer;
}

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



function unite(arr1, arr2, arr3) {
  return Array.prototype.slice.call(arguments).reduce(function(prev_arr, curr_arr, index) {
    return prev_arr.concat(curr_arr.filter(function(num) {
      return prev_arr.indexOf(num) === -1;
    }));
  }, []);
}

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

{'fraction_non_alphanumeric': 0.216, 'fraction_numerical': 0.043, 'mean_word_length': 3.085714285714286, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5126161', 'n_tokens_mistral': 424, 'n_tokens_neox': 395, 'n_words': 89}