I have this array, which is user generated and changes over time:
const data = [["2020-09-14","15:00","60","Info","April Tucker","Other","yes"],
["2020-09-14","2:00","50","Text","April Tucker","Other","yes"]]
User picks a date which saves to sessionStorage (for example: 2020-11-21):
sessionStorage.getItem('date')
Then I use forEach method to know if the first item of array item has the same value:
const checkForConflicts = () => {
mydata.forEach((element) => {
element.includes(sessionStorage.getItem('date'))
})
}
If I console log that I get boolean value for all item in the array. How to return only one boolean value, true if checkForConflict returns only false values, or false value if it returned alt least one true value.
checkForConflictdoesn't return anything...Array.prototype.everyandArray.prototype.some. This should enable you to pick the right tool(s).