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


Is it "proper programming" to declare multiple variables in one line? I.e. var a, b, c, d = 4

1st Nov 2016, 5:02 PM
Devon McCauley
Devon McCauley - avatar
3 Answers
+ 2
yes then use it where required,but if you declare variables and not use then this is not good because variable hold space
1st Nov 2016, 5:14 PM
Umer Waleed Hashmi
Umer Waleed Hashmi - avatar
for claity, if you want any of them to have initial values, it is suggested to have them on separate lines, but not absolutely necessary.
24th Nov 2016, 4:47 PM
David-Hesh Hochhauser
David-Hesh Hochhauser - avatar
I still don't understand how the variable work's.
17th Jan 2017, 3:40 PM