Debugging JavaScript nested loops with querySelector

Debugging JavaScript nested for-loops with querySelector DOM manipulation involves checking your functions, arrays, syntax, variable declaration, and structure. That's a lot, even for simple functionality. The attached screenshot is the code (manually typed) that looks clean, but does not modify the HTML <li> content one bit. The error did not appear to be in the HTML side. Eventually I commented this code out and restarted, using different variable names, and the code produced the expected output. The issue might have been parameters or arguments not being called properly, or some other misspelling or missing/extra character.

  • No alternative text description for this image

To view or add a comment, sign in

Explore content categories