+ 1
Help me to make this code.
I want to make the led light but something is wrong with my code see my comments in the code. https://code.sololearn.com/WGBzCcZYCMjQ/?ref=app
3 Réponses
+ 6
Airree I'd say it was inefficient and unnecessary. He may not yet be familiar with loops, much less functional Array methods.
That said, loops and unique ids aren't needed at all for this.
+ 5
Adnan Ansari Move line 51 to 56.
+ 4
Hi there. You might not know this, but object properties can't be changed like that. Maybe you might want to first have the object, then get input.value, it will work better, trust me
Also, declaring 15 variables like this is kind of stupid. You might be able to do it better:
let elements = new Array(15).fill(0).map((_, i) => document.getElementById(String.fromCharCode(i + 65));
This should create an array of all the 15 elements