✅ JavaScript | Easy
\n/**\n * @param {number[][]} grid\n * @return {number[][]}\n */\nvar largestLocal = function(grid) {\n    const ans = [];\n        \n    for (let r = 0; r < gr
```\n/**\n * @param {number[][]} grid\n * @return {number[][]}\n */\nvar largestLocal = function(grid) {\n    const ans = [];\n        \n    for (let r = 0; r < grid.length - 2; r++) {\n        const row = [];\n        for (let c = 0; c < grid[r].length - 2; c++) {\n            row.push(Math.max(\n                grid[r][c], grid[r][c + 1], grid[r][c + 2],\n                grid[r + 1][c], grid[r + 1][c + 1], grid[r + 1][c + 2],\n                grid[r + 2][c], grid[r + 2][c + 1], grid[r + 2][c + 2]\n            ));\n        }\n        ans.push(row);\n    }\n\n    return ans;\n};\n```
['Matrix', 'JavaScript']