Simple solution | only using array and for loop
Code

# Code
```javascript []
/**
 * @param {number[][]} isWater
 * @return {number[][]}
 */
var highestPeak = function(isWater) {
    const n = isWater.length;
    const m = isWater[0].length; 
    const res = Array.from({ length: n }, () => Array(m).fill(-1)); 
    const queue = [];

    for (let i = 0; i < n; i++) {
        for (let j = 0; j < m; j++) {
            if (isWater[i][j] === 1) {
                res[i][j] = 0;
                queue.push([i, j]);
            }
        }
    }

    const directions = [
        [0, 1], [1, 0], [0, -1], [-1, 0]
    ]; 
    let front = 0; 
    while (front < queue.length) {
        const [x, y] = queue[front++];
        for (const [dx, dy] of directions) {
            const newX = x + dx;
            const newY = y + dy;

            if (newX >= 0 && newX < n && newY >= 0 && newY < m && res[newX][newY] === -1) {
                res[newX][newY] = res[x][y] + 1;
                queue.push([newX, newY]); 
            }
        }
    }

    return res;
};

```
['Array', 'Breadth-First Search', 'Matrix', 'JavaScript']