Variable special characters | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Variable special characters

it says that special symbols can't be used in variable names however in the lesson "Naming Variables" it stated that The first character can be a letter, an underscore (_), or a dollar sign ($). Can someone clarify this contradiction?

17th Nov 2018, 12:40 AM
john leung
1 Answer
0
When you go to declare a variable, you have to give a name of the variable!! The name can be be started with a letter (a,b,c etc), you can also use $ and _ sign!! But others sign such as (#,*,@, etc) is not allowed!! https://code.sololearn.com/Wn5P8diAj6m7/?ref=app Remove // from 8 and 9th line to prove it!
17th Nov 2018, 1:19 AM
AL Araf
AL Araf - avatar