How to change variables in Javascript? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to change variables in Javascript?

For example: var a = "" if (___){var a = "apple"} And my code: https://code.sololearn.com/W4m6pm8Jd3CK/?ref=app

27th Aug 2022, 11:13 PM
Chris
1 Answer
0
To change value you write => variable_name = new_value, but if you write var again JS create new local variable
31st Aug 2022, 9:56 AM
Mahmoud Mohamed
Mahmoud Mohamed - avatar