2048 spawns new numbers randomly on the board. A human player uses that information to determine the best move.
Grid.prototype.randomAvailableCell = function () {
var cells = this.availableCells();
if (cells.length) {
return cells[Math.floor(Math.random() * cells.length)];
}
};