Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
C0D4681456yThis is this but it's also that and when it's not this it's probably that, or this was replaced by that and that is no longer this.
I don't even know what I'm thising about anymore.
You should only use this.foo() When you know what this is. -
this can be tricky, but isn't a problem in general...
use your arrow functions, and don't destructure instance methods and you'll be fine (as long as on es5+)
if not on es5, then yes, a pain in the ass because you need to save the this value before entering an inner function like array forEach. -
mojo20128146yWell .... JS in general is a highly inconsisten language, so why do you even wonder?
-
@mojo2012 that is a very dumb comment. By that logic, you can't never point out anything in any flawed technology because "why are you surprised?"
-
I love how `this` in a function in a class does not refer to the class (: truly intuitive
-
Ever wondered why JS devs use to say "what is this shit"?
I think "this" should be extended by "that" where "that" somehow refers to something one level up in the hierarchy, would be fun. -
@ganjaman what? it never refers to the class on any lang, `this` always refers to the instance
do you even code bro? -
@ganjaman
a black woman in the us has 5 children, michael, michael, michael, michael and michael.
how does she tell them apart?
by the last name
so, yes, i am fun at parties. i was also referencing the "do you even lift bro" meme.
anyhow you can tell the diff between instance and class right? if you can't then don't pollute with misinformation -
@jesustricks when i wrote class, i clearly meant instance and everyone knows that also that was a shit joke, 2/5
-
@ganjaman Also, women don't like objects because they're into functional programming.
-
@ganjaman cool man, i will get off your ass, please don't make jokes that can confuse the fuck out of beginners
-
mundo0349796yThis is always this in the current scope.
The issue is you don't know what te scope is because JS sucks due ti being a hacked togheter piece of shit.
Every new ES version is even worse.
Tl;dr Fuck JS -
mundo0349796y@jesustricks I meant ever time JS imomement something from ES.
ES is good.
JS on the other hand, feels hackier, dirtier, shitier.
The most shit they add, the more dependencies, bad practices, you need to add to your workflow.
The environment is shit, the philosophy is shit, the community is shit too.
And I know, if you are a JS fan, you will defend it, my point is, you are not a JS fan, you are a node fan.
Has anybody noticed that "this" in JavaScript is sort of a pain in the ass to keep track of? It appears to have identity issues.
rant