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
-
hexc11266yCode layout aside you should switch to 'let' instead of 'var', the newer let version enforce cleaner code, might even show you previously unseen bugs with your code.
-
@hexc yeah.. it's not my code in a first place. And layout got messed up by devrant
-
@Divisionbyzero yeah.. the problem was the 'this' part. Apparently in that particular context 'this' was referencing a Mapper rather than my class.
Still that makes no sence to me... -
Wombat105826y@netikras well then your rant was lying. 😉
It needs a deeper understanding of JavaScript to understand the this-context. Have you used es6 syntax? -
@Divisionbyzero How can a rant be lying? :) I never told I'm good at JS or FE in general. It just does not make any sense to me which is God damn frustrating. Apparently 'this' in JS and 'this' in BE languages are different things..
What the f*...
SomeType {
var something = {
somethingElse: "blah",
whatever: "halb"
}
var doStuff = function() {
this.something.whatever = "foo";
}
}
Based on what fucking logic are you claiming "something" is _undefined_ while running doStuff()??? What the fuck is wrong with you??? It's a freakin' static context!!!! "SOMETHING" IS DESIGNED TO BE DEFINED ! ! ! ! !
rant
typescript
undefined
javascript