Conversation
created board that is clickable. unable to figure out how to randomize spans.
shuffle function and more
| var self = this | ||
| this.div.click(function(){ | ||
| self.handleClick(); | ||
| }) |
There was a problem hiding this comment.
FYI, you could also write this as this.div.click(this.handleClick.bind(this)).
There was a problem hiding this comment.
Yes, I sort of remember talking about this in class. I also just watched a tutorial about factory functions and how to avoid using "this", so trying to process that too, hehe.
|
Looks good overall! Take a look at the warnings, as it makes some good suggestions. In particular, using semicolons or not is fine (I would recommend the former), but please be consistent about it! |
|
I still have a little confusion as to when to use other classes vs subclasses. With the "shuffle" and "removeAndPrintElements" functions, should that they been put into its own class or somehow included in the Tile class? |
|
A subclass makes sense when you have a more specialized version of a thing, e.g. if this game were to have a concept of |
created board that is clickable.
unable to figure out how to randomize spans.