Created
August 13, 2016 14:13
-
-
Save AJFaraday/56e258000227b4d46003ec9cb304e45c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// I'm trying to hide most of the JS class and provide a public API in this style. | |
GridGame.classes.board = function () { | |
this.rows = [['1', '2'], ['3', '4']]; | |
this.draw_row = function (row_index, row_tiles) { | |
//... | |
}; | |
return { | |
draw: function () { | |
GridGame.table.empty(); | |
$.each(this.rows, this.draw_row); | |
} | |
} | |
}; | |
// It's not working because within the returned object, 'this.rows' and 'this.draw_row' are undefined. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment