Sudoku solver in JavaScript using backtracking