I use something similar to the following:
However, I do not get why this method has access to the this.color property of the pawn1 object. Because if you do:
chessPiece.getColor(), the method can't return this.color, as this.color is not part of the chessPiece object nor is it anywhere up its prototype chain.
I hope I have made my question clear enough, as I found it difficult to explain. Let me know if I dont make any sense to you and I will do another attempt!
Thanks in advance,