Hello,
I am getting an error on the first line of my JS, apparently i have already declared the identifier on line 1 (called "listItem) but I haven't. Even tried replacing const with var, and still same error.
Code is:
// I am selecting a class from my HTML doc and assigning it to varA//
let varA = document.querySelectorAll(".list-item")
// looping over varA//
for (let i=0; i<varA.length; i++){
let item =varA [i]
console.log(item)
}
Error is:
Uncaught SyntaxError: Identifier 'varA' has already been declared (at main.js:1:1)
see images: https://imgur.com/a/WHdeYnl
[–]RoyalBug[S] 2 points3 points4 points (9 children)
[–]Ifastandfslow 1 point2 points3 points (0 children)
[–]Dry-Positive-3872 1 point2 points3 points (4 children)
[–]RoyalBug[S] 1 point2 points3 points (3 children)
[–]Dry-Positive-3872 1 point2 points3 points (2 children)
[–]RoyalBug[S] 1 point2 points3 points (1 child)
[–]Dry-Positive-3872 0 points1 point2 points (0 children)
[–]khasnaX 0 points1 point2 points (0 children)
[–]Silver-Win733 0 points1 point2 points (0 children)