Like many people, I used 4 spaces for years, but 2 spaces has definitely been winning in JS culture. It's been the standard at the last few gigs I've consulted for and is also standard on many OSS projects.
After using it for a while I like it. It's especially nice for nested ternaries:
38
u/mrkipling Mar 27 '15
Yes - they suggest a tab indent of 2 spaces instead of the obviously-correct value of 4. Hence, mostly reasonable :)