4

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 ! ! ! ! !

Comments
  • 1
    Code 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.
  • 0
    @hexc yeah.. it's not my code in a first place. And layout got messed up by devrant
  • 0
    I really doubt JavaScript is the source of your error.
  • 0
    @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...
  • 0
    @netikras well then your rant was lying. 😉
    It needs a deeper understanding of JavaScript to understand the this-context. Have you used es6 syntax?
  • 0
    @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..
  • 0
    @netikras probably true.
  • 0
    Try accessing SomeType.something.whatever
    or assign this = SomeType
Add Comment