console.log(this.tiles.find(this.findStart))
When using the following code snippet:
findStart: function (value) {
var x = 5, y = 10;
return value.x === x && value.y === y
},
The expected results are returned. However, when substituting it with the code below:
findStart: function (value) {
var x = this.room.startX, y = this.room.startY;
return value.x === x && value.y === y
},
The correct "this" value needs to be passed to the second set of code. How can I achieve this?