Nested For Loops JavaScript Solution
Found this solution helpful? Consider showing support by upvoting this post.\nHave a question? Kindly leave a comment below.\nThank you and happy hacking!\n\nva
Found this solution helpful? Consider showing support by upvoting this post.\nHave a question? Kindly leave a comment below.\nThank you and happy hacking!\n```\nvar largestLocal = function (grid) {\n    let result = []\n\n    for (let i = 1; i < grid.length - 1; i++) {\n        let resultRow = []\n        for (let j = 1; j < grid[i].length - 1; j++) {\n\t\t//Finds the largest interger of the nine elements within each 3 x 3 sub-grid\n            let max = Math.max(\n                grid[i - 1][j - 1],\n                grid[i - 1][j],\n                grid[i - 1][j + 1],\n\n                grid[i][j - 1],\n                grid[i][j],\n                grid[i][j + 1],\n\n                grid[i + 1][j - 1],\n                grid[i + 1][j],\n                grid[i + 1][j + 1]\n            )\n            resultRow.push(max)\n        }\n        result.push(resultRow)\n    }\n\t\n    return result\n};\n```
['JavaScript']