MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/javascript/comments/30hyan/airbnb_javascript_style_guide_a_mostly_reasonable/cptko14/?context=3
r/javascript • u/mrkipling • Mar 27 '15
158 comments sorted by
View all comments
3
I'm not a massive fan of marking private variables on this with leading underscores. I prefer to create a variable in the closure scope.
It prevents someone from changing it when you don't expect them to.
2 u/theycallmemorty Mar 28 '15 Me too but it really ties you're hands of you want to inherit from the class down the road. 2 u/[deleted] Mar 28 '15 [removed] — view removed comment 2 u/bio595 Mar 28 '15 Agreed, private means private, not protected (which doesn't really make sense in js anyway)
2
Me too but it really ties you're hands of you want to inherit from the class down the road.
2 u/[deleted] Mar 28 '15 [removed] — view removed comment 2 u/bio595 Mar 28 '15 Agreed, private means private, not protected (which doesn't really make sense in js anyway)
[removed] — view removed comment
2 u/bio595 Mar 28 '15 Agreed, private means private, not protected (which doesn't really make sense in js anyway)
Agreed, private means private, not protected (which doesn't really make sense in js anyway)
3
u/bio595 Mar 28 '15 edited Mar 28 '15
I'm not a massive fan of marking private variables on this with leading underscores. I prefer to create a variable in the closure scope.
It prevents someone from changing it when you don't expect them to.