I encountered an issue while working on a project and I noticed that it was as a result of the curly braces in my function... quick example
const array1 = [1,2,3,4,5,6];
const array2 = [2,4,6];
const isPresentInBothArrays1 = array2.every((number)=>{
array1.includes(number);
});
console.log(isPresentInBothArrays1) //prints false;
const isPresentInBothArrays2 = array2.every((number)=>array1.includes(number));
console.log(isPresentInBothArrays2) //prints true;
why does isPresentInBothArrays1 with curly braces return false and IsPresentInBothArrays2 without curly braces return true?