I have two arrays, one with alphabetical letters and another array with words. I need to find all the letters that dont have a word in other array which starts from that letter. For example:
arr1 = [apple, bee, mom, dog] arr2 = [a,b,c,d]
I need a function which finds letter c from arr2, because it does not have any word starting from this letter.
My app has buttons with letters, and each letter has some content starting from that letter. I want to highlight the letters that have no content in there.
This is what I tried to do, and it works with === operator, but doesnt work with !=.
for(let i = 0; i < searchItemsTitle.length; i++) {
for(let e = 0; e < letterButtons.length; e++) {
if(searchItemsTitle[i].innerText.charAt(0) === letterButtons[e].innerText.charAt(0)) {
letterButtons[e].classList.add("a-z-grey-letter");
console.log(letterButtons[e].innerText)
}
}
}