MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/javascript/comments/a6txtp/coming_from_python_to_js/ec00f3c/?context=3
r/javascript • u/chroner • Dec 16 '18
const print = console.log
I found my safe space.
156 comments sorted by
View all comments
94
If I came across that shit at work, I'd git blame in a heartbeat and tell you to never do that again.
git blame
But if you're doing it in personal projects, more power to you, I guess. Nothing really wrong with it code-wise.
0 u/spazz_monkey Dec 17 '18 There's a dude at my work who did this in production code.self = this 16 u/_xiphiaz Dec 17 '18 This used to be super common when creating JavaScript libraries before modules and arrow functions; it was used to maintain a reference to the parent scope for use within a callback function 1 u/alejalapeno Dec 17 '18 I prefer(ed) _this = this
0
There's a dude at my work who did this in production code.
self = this
16 u/_xiphiaz Dec 17 '18 This used to be super common when creating JavaScript libraries before modules and arrow functions; it was used to maintain a reference to the parent scope for use within a callback function 1 u/alejalapeno Dec 17 '18 I prefer(ed) _this = this
16
This used to be super common when creating JavaScript libraries before modules and arrow functions; it was used to maintain a reference to the parent scope for use within a callback function
1 u/alejalapeno Dec 17 '18 I prefer(ed) _this = this
1
I prefer(ed) _this = this
_this = this
94
u/mishugashu Dec 16 '18
If I came across that shit at work, I'd
git blamein a heartbeat and tell you to never do that again.But if you're doing it in personal projects, more power to you, I guess. Nothing really wrong with it code-wise.