It doesn’t!

lightColumn(‘J’);

(10) ["", “”, “”, “”, “”, “”, “”, “”, “”, “”]

lightColumn(‘K’);

“Column outside of GRID”

That was run in chrome’s inspector of course

Here is my full code if you want to play with it:

##
Full Code

function countRows() {

return GRID.length;

}

function countColumns() {

return GRID[0].length;

}

function gridSize() {

var rows;

var cols;

var grid;

rows = countRows();

cols = countColumns();

grid = cols + " x " + rows;

return grid;

}

function totalCells() {

var rows;

var cols;

var size;

rows = countRows();

cols = countColumns();

size = rows * cols;

return size;

}

function convertColumn(coordinate) {

if (coordinate[0].match(/[A-Z]/)) {

var rtn = coordinate[0].charCodeAt(0) - 65;

return rtn;

} else {

return “Coordinate out of GRID”

}

}

function lightCell(coordinate) {

var xVal;

var yVal;

xVal = convertColumn(coordinate);

yVal = coordinate[1] - 1;

return GRID[yVal][xVal];

}

function isRock(coordinate) {

cell = lightCell(coordinate);

if (cell === “^”) {

return true;

} else {

return false;

}

}

function isCurrent(coordinate) {

if (lightCell(coordinate) === “~”) {

return true;

} else {

return false;

}

}

function isShip(coordinate) {

if (lightCell(coordinate) === “v”) {

return true;

} else {

return false;

}

}

function lightRow(row) {

if (row > GRID.length || row < 1) {

return “Row outside of GRID”;

} else {

row -= 1;

return GRID[row];

}

}

function lightColumn(column) {

var result = [];

var col = convertColumn(column);

if (col >= GRID[0].length || col < 0) {

return “Column outside of GRID”;

} else {

for (var i = 0; i < GRID[0].length; i++) {

result.push(GRID[i][col]);

}

return result;

}

}