code: function getPiecesWhereCanIGo(board, positions) {
      return positions.map(function (position) {
          var x = position.x,
              y = position.y,
              isBlack = position.isBlack;
  
          return {
              x: x, y: y, isBlack: isBlack,
              whereCanIGo: getPositionsWhereCanIGo(board, position)
          };
      });
  }
docs: Gets all pieces with whereCanIGo positions.