+ 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

6th Jul 2019, 7:35 PM
Adnan Ansari
Adnan Ansari - avatar
3 odpowiedzi
+ 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.
6th Jul 2019, 8:28 PM
David Carroll
David Carroll - avatar
+ 5
Adnan Ansari Move line 51 to 56.
6th Jul 2019, 8:12 PM
David Carroll
David Carroll - avatar
+ 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
6th Jul 2019, 8:03 PM
Airree
Airree - avatar