I am trying to map an array in order to get a Boolean for each iteration after comparing two arrays.
Compare if the values of array
aare included intob.Get an array of Booleans, returning the result of each iteration made in the
every()method
I thought of using a combination of every() and map()
This is how far I went:
let a = [1,2,4];
let b = [1,2,3]
let answer = a.every(num => b.includes(num))
console.log(answer)
// returns false
I tried placing the callback of every() inside a map() method without success.
I know that every() iterates, so somehow it should be easy to the an array of each iteration like:
[true,true,false]
Thanks in advance!