let a = [[], [], ['a', 'b', 'c']];
let b = saveArrDups(a);
console.log(b); // [];
let a = [['a'], ['a'], ['a', 'b', 'c']];
let b = saveArrDups(a);
console.log(b); // ['a', 'a', 'a'];
let a = [['a', 'a','b','b'], ['c','b','a'],['a','c','b']];
let b = saveArrDups(a);
console.log(b); // ['a', 'b'];
Get only duplicates from array of arrays
Example:
let a = [[], [], ['a', 'b', 'c']]; let b = saveArrDups(a); console.log(b); // []; let a = [['a'], ['a'], ['a', 'b', 'c']]; let b = saveArrDups(a); console.log(b); // ['a', 'a', 'a']; let a = [['a', 'a','b','b'], ['c','b','a'],['a','c','b']]; let b = saveArrDups(a); console.log(b); // ['a', 'b'];