We receive an array of text strings. We need to locate the position of the word "JavaScript" in the array and return its position as an array of two elements: the row index and the column index.
function findWord(matrix, word) { let rowIndex = 0; let colIndex = 0; for (let i = 0; i < matrix.length; i++) { // i = row for (let j = 0; j < matrix[i].length; j++) { // j = column if (matrix[i][j] === word) { rowIndex = i; colIndex = j; } } } let wordIndex = [rowIndex, colIndex]; return wordIndex; } const data = [ ['JavaScript', 'Python', 'PHP'], ['JavaScript', 'C++', 'Java'], ['Python', 'Go', 'C++'] ]; findWord(data, 'Java')