Group 1 = [X, , , , ,X]
Group 2 = [ , , ,O, , ]
I am looking for a way to combine group 1 with group 2 in order to achieve the following arrangement: [X, , , O, ,X] without simply replacing Group 1 with Group 2..
Here is the code snippet I have so far:
tictactoe.put('/updateBoard/:gameId', function (req, res) {
Game.findOneAndUpdate({"gameId": req.params.gameId}, {
"$set": {
gameProgress: req.body.board
}
}, (err, data) => {
if (err) {
return res.status(500).send(err);
}
return res.status(200).json(data);
});
});
Any suggestions?