[HELP] Sleepwalkers Javascript

I don’t know what’s wrong, here is my code. Any help is appreciated.

// Senick's prepared the grid map how to build fences.
var hunter = hero.findNearest(hero.findFriends());
var fenceMap = hunter.getMap();

// This function converts grid into XY coordinates.
function convertCoor(row, col) {
    return {x: 34 + col * 4, y: 26 + row * 4};
}


// Iterate over fenceMap and build at fence at all 1s.
for(var i = 0; i < fenceMap.length; i++){
    for(var j = 0; j < fenceMap[i].length; j++){
        if (fenceMap[j] == 1 && fenceMap[i] == 1){
            var coor = convertCoor(i, j);
            hero.buildXY("fence", coor.x, coor.y);
        }
    }
}
// Move back to the village after building the fences.
hero.moveXY(22, 15);

hello and welcome to the forum mind if you give me the link?

Welcome to the forum! This is a family-friendly place where coders can share bugs, ask for help on any CodeCombat level (don’t forget to post your code correctly), or just hang out with other coders. But before you proceed, please check out our guidelines: this topic.
Have a great time! :partying_face: