JSFiddle - React, Tailwind, and code Playground

JavaScript

var a = [1,2,3], b = [2,3,4];
var c = a.concat(b);
    
function arrays( array ) {
    var distinct = [], unique = [], repeated = [], repeat = [];
    
    array.forEach(function(v,i,arr) {
        arr.splice(i,1);
        ( distinct.indexOf(v) === -1 ) ? distinct.push(v) : repeat.push(v);
        ( arr.indexOf(v) === -1 ) ? unique.push(v) : void 0;
        arr.splice(i,0,v);
    });
    
    repeat.forEach(function(v,i,arr) {
        ( repeated.indexOf(v) === -1 ) ? repeated.push(v) : void 0;
    });
    
    repeat = [];
    
    return {
        "distinct" : distinct,
        "unique"   : unique,
        "repeated" : repeated
    };
}
    
console.log(arrays(c));