Help, code not working as expected | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 7

Help, code not working as expected

Check this code: https://code.sololearn.com/WkPwumi8GZbq/?ref=app 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 Respostas
1st Jan 2019, 5:05 PM
ODLNT
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. https://code.sololearn.com/W6GY7fIuwB8j/?ref=app
31st Dec 2018, 3:14 PM
TheWhĀ”teCat šŸ‡§šŸ‡¬
TheWhĀ”teCat šŸ‡§šŸ‡¬ - avatar
- 1
hi
1st Jan 2019, 8:05 AM
Mohammad
Mohammad - avatar