+ 1
Adding with Date object
Why can’t i add a number to a number derived from a Date object? Look at line 25 and 26 and explain what i am doing wrong. Please ignore anything that is commented out. https://sololearn.com/compiler-playground/WRX3oPcBfVZ7/?ref=app
4 Respostas
+ 3
Firstly, you need to wrap your entire js code inside window.onload = () => {}
Another issue is that d is a constant and you are trying to change its value, if you want to change its value then use let or var keyword.
+ 1
Gulshan Mahawar i don’t beleive i just spent an hour on that! Wow, do i feel dumb.☹️🙄
+ 1
Ok I fixed it up and even added the window.onload for android users.
0
Zvi Don't worry, happen sometimes 👍