Javascript Array has_coord(a)
Array.prototype.has_coord = function(a){ for (var i = 0; i < this.length; i++) if (a.x == this[i].x && a.y == this[i].y) return true;/*from ww w. j a va 2 s . c om*/ return false; }