13
Awlex
7y

I SPEND 15 MINUTES LOOKING FOR AN ERROR. WHY IS THIS A THING

Comments
  • 2
    Maybe this is referring to something else?
  • 4
    Returning an object

    That's why.

    You're referring to what you're returning in the non-working version.

    Seems weird, yeah, but code rarely lies.
  • 0
    Hmm.. Wierd. New property values should be evaluated in the context of the closure they are in, not what object you are assigning them to. Maybe the value isn't defined synchronously, and the wierdness is due to timing?
  • 1
    @AlgoRythm @OneOrZero thanks for the advice. Now I understand why js devs don't know what this stands for...
Add Comment