How can I add 1 to variable? (line 26) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3
3rd Aug 2019, 3:05 PM
Jakob Eckl
4 Answers
3rd Aug 2019, 4:00 PM
VEDANG
VEDANG - avatar
+ 5
Use += instead of =+
3rd Aug 2019, 11:49 PM
Sonic
Sonic - avatar
+ 4
line 34 addcookie() not addcookie1()
3rd Aug 2019, 3:15 PM
Gordon
Gordon - avatar
+ 1
because ‘cookies’ is a constant (designated by ‘let’) instead of a variable (designated by ‘var’), you cant change the value of cookies from 0. try changing line 15 to ‘var cookies = 0’ and line 26 to cookies++, cookies += 1, or somthing similar. that should solve your problem.
8th Aug 2019, 11:41 AM
Caleb Hansen
Caleb Hansen - avatar