我想用子例程(称为if (!updatedGame) {
throw new NotFoundError("HTTP 404 Not Found: No Games Here");
}
if (update.color && !validColor(update.color)) {
throw new BadRequestError("HTTP 400 Bad Request: No Such Color");
}
if (update.board !== undefined && moves(update.board, updatedGame.board) > 1) {
throw new BadRequestError("HTTP 400 Bad Request: Only one move allowed. Wait your turn");
}
console.log("Game has been updated");
return Game.merge(updatedGame, update).save();
)中的值在array
中更改array2
和main()
。我的代码:
change()
答案 0 :(得分:1)
您必须将返回值分配给变量
[1, 2]
[3, 4]