DEV Community

Discussion on: How should we indent `const` declarations?

Collapse
 
jenc profile image
Jen Chan

Uhh wait. There ARE const indentations...?

Collapse
 
kenbellows profile image
Ken Bellows

What do you mean?

Collapse
 
emgodev profile image
Michael • Edited

No, he just meant as a practice, indenting a block of identifiers. Rather than declaring identifiers one line at a time, you can delimit them with commas to share a single statement.

let a = '1', b = '2';

So you indent them on a new line to indicate they share the same keyword but are still related.

let a = '1',
    b = '2';