JavaScript DFS
js\n// Helper Func\nconst isOutOfBound = (board, row, col) => row < 0 || row >= board.length || col < 0 || col >= board[0].length;\n\nconst checkNeighbors = (bo
```js\n// Helper Func\nconst isOutOfBound = (board, row, col) => row < 0 || row >= board.length || col < 0 || col >= board[0].length;\n\nconst checkNeighbors = (board, word, row, col) => {\n    // Check exit conditions\n    if (!word.length) return true;\n    if (isOutOfBound(board, row, col) || board[row][col] !== word[0]) return false;\n    \n    // Save some stuff\n    const curChar = board[row][col];\n    const newWord = word.substr(1);\n\n    board[row][col] = 0; // Disable the current character\n    \n    // Check if neighbors are fruitful\n    const results = checkNeighbors(board, newWord, row + 1, col) ||\n        checkNeighbors(board, newWord, row - 1, col) ||\n        checkNeighbors(board, newWord, row, col + 1) ||\n        checkNeighbors(board, newWord, row, col - 1);\n\n    // Enable current character\n    board[row][col] = curChar;\n\n    return results;\n};\n\n\nvar exist = function(board, word) {    \n    for (let row = 0; row < board.length; row++) {\n        for (let col  = 0; col < board[0].length; col++) {\n            if (checkNeighbors(board, word, row, col)) return true;\n        }\n    }\n    return false;\n};\n```
['JavaScript']