Why does this not display the count | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why does this not display the count

When I log the count, it should continue going up by 1 for each time I hit run, why does this not happen https://code.sololearn.com/WgKxYHDNHXRe/?ref=app

8th Mar 2019, 3:26 AM
Pierson
Pierson - avatar
6 Answers
+ 2
https://code.sololearn.com/WXxhfDY6bz0P/#html
8th Mar 2019, 7:27 AM
ODLNT
ODLNT - avatar
+ 1
Pierson In your code, console.log(Number) is telling the computer to display js global function Number. To display the contents of localStorage.Number use console.log(localStorage.getItem("Number")) or console.log(localStorage.Number) Btw - because Number is a js global function you should avoid using the word Number in any other manner. It can cause some confusion.
8th Mar 2019, 5:48 AM
ODLNT
ODLNT - avatar
+ 1
Thank You
8th Mar 2019, 7:38 AM
Pierson
Pierson - avatar
+ 1
You are welcome. From both of us.😁
8th Mar 2019, 7:53 AM
ODLNT
ODLNT - avatar
0
Wait so what do I use instead, I changed it to watch instead to get rid of the function "Number", but now it says that "Watch" is undefined even though nothing has changed except the variable https://code.sololearn.com/WgKxYHDNHXRe/?ref=app
8th Mar 2019, 7:21 AM
Pierson
Pierson - avatar
0
😂 I swear it had 2 different names Full Code Can Be Viewed Here: https://code.sololearn.com/WfF1U5tJOzlG/?ref=app
8th Mar 2019, 8:16 AM
Pierson
Pierson - avatar