Help with javascript `this` keyword and `bind`

It’s hard to analyze it w/o seeing the whole context, but I’ll try.

I believe you’ve meant new Gpoint instead of newGpoint, right?

Anyways, isn’t your Grid::make_Gpoint() method supposed to return a Gpoint instance?

Why do you instead assign it to some global variable inside that method?
That’s bad OOP coding practice!

What you describe above shouldn’t happen!

Property Gpoint::grid seems to be properly initialized w/ a Grid object.

So this.grid.someProp should work as long as someProp is a member of Grid.

1 Like