79133235

Date: 2024-10-28 11:51:27
Score: 1
Natty:
Report link

Thank you everyone for your comments. Based on those comments, I added the following line to my code:

const markedSpaceNumbers = markedSpaces.map(Number);

My method now reads:

const checkIfMarksAreCorrect = () => {
    const spaces = document.querySelectorAll(".marker");
    const markedSpaces = Array.from(spaces)
        .filter((space) => space.classList.contains('marked'))
        .map((markedSpace) => markedSpace.textContent.trim());
    console.log('The marked spaces are: ' + markedSpaces);
    console.log(`checkIfMarksAreCorrect ballsDrawn: ${ballsDrawn}`);
    const markedSpaceNumbers = markedSpaces.map(Number);
    const legitSpaces = markedSpaceNumbers
        .filter((markedNumber) => ballsDrawn.includes(markedNumber));
    console.log('legitSpaces: ' + legitSpaces);
};

Everything is working now! Thanks again!

Reasons:
  • Blacklisted phrase (0.5): Thank you
  • Blacklisted phrase (0.5): Thanks
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: apex2022