How can I pass more than one arg in a function without knowing the number of args that I will need to pass?
function uniteUnique(arr) {
(do somthing here)
}
uniteUnique([1, 3, 2], [5, 2, 1, 4], [2, 1]);
what I mean is the func above receive one arg, but the function is called with 3 arg this time, but in other exercise is called with 4 arg.
The best solution in my case was using arguments
function uniteUnique( ){
console.log(arguments)
}
uniteUnique([1, 3, 2], [5, 2, 1, 4], [2, 1]);
// logs { '0': [ 1, 3, 2 ], '1': [ 5, 2, 1, 4 ], '2': [ 2, 1 ] }
// i can work with this