Talk to people, all good?
My question is simple, but the solution may not be as simple as that.
The truth is that I am doing a job in JS and soon I will need to solve a problem that will make me lose a few hours breaking my head.
So I decided to ask here in StackOverflow to advance some of the solution.
Let's face it.
Suppose I have declared 5 arrays, then:
var objetos = ["abridor de garrafa", "abridor de latas", "adaga", "ábaco", "abajur", "abotoadura", "acetona", "açucareiro", "zabumba", "xícara", "zarabatana", "xilofone"];
var redondos = ["ábaco", "abajur", "abotoadura", "acetona", "açucareiro", "zabumba", "xícara"];
var cozinha = ["abridor de garrafa", "abridor de latas", "açucareiro", "xícara"];
var arma = ["adaga", "zarabatana"];
var musical = ["xilofone", "zabumba"]
Now, I need a function that when I pass 2 (or more) arrays, it returns me a new array, containing only the strings that are present in ALL the arrays I've passed.
Exemplifying:
If I give the function the arrays: "objects", "round" and "musical", the new array I receive should only contain "zabumba".