Answer the question
In order to leave comments, you need to log in
How do you declare variables in nodejs?
In pure js, it is customary to declare properties separated by commas with one declaration statement -
var a = 0,
b = 1,
c = 3;
var a = 0;
var b = 1;
var c = 2;
Answer the question
In order to leave comments, you need to log in
And as you wish. I like the first option, but it has one unpleasant minus - in git logs, adding a variable will affect two lines and not one:
var a,
b;
var a,
- b;
+ b,
+ c;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question