My current code looks something like this:
let bestScore = -Infinity let move; for(i = 0; i < board.length; i++) { for(j = 0; j < b