Help, code not working as expected | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 7

Help, code not working as expected

Check this code: If you execute the code the following happen: - Upon launch the first row doesn't get highlighted. - For every successive highlight, the last cells of the first row, first column and the first diagonal (top left to bottom right) do not get highlighted. What is wrong and how do I fix this?

31st Dec 2018, 2:34 PM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
3 Answers
1st Jan 2019, 5:05 PM
ODLNT - avatar
+ 2
I think it is because of the set time 300 ms. As an asynchronous function it waits for completion. Maybe because time gap is long enough it starts the next loop removing class name attribute "mark". I tried your code with time 100 ms and it works normally.
31st Dec 2018, 3:14 PM
TheWh¡teCat 🇧🇬
TheWh¡teCat 🇧🇬 - avatar
- 1
1st Jan 2019, 8:05 AM
Mohammad - avatar