code: function hasPositionByBoardSize(boardSize, position) {
      return position && position.x >= 0 && position.y >= 0 && boardSize.y > position.y && boardSize.x > position.x;
  }
docs: Checks if position exists in this board size