Question 1 of 30
A software developer is tasked with creating a program that manages a 2D grid representing a game board, where each cell can hold a different value indicating the state of that cell (e.g., empty, occupied, or blocked). The developer decides to use a multidimensional array to represent this grid. If the grid is defined as `let gameBoard = [[0, 1, 0], [0, 0, 1], [1, 0, 0]];`, what will be the output of the following code snippet that counts the number of occupied cells (represented by the value `1`) in the grid?
javascript
occupiedCount = 0;
(let i = 0; i < gameBoard.length; i++) {
(let j = 0; j < gameBoard[i].length; j++) {

Preparing for Microsoft 98-382 Introduction to Programming Using JavaScript? Now land the interview.

73% of qualified candidates get rejected because of weak resumes. Build an ATS-optimized, recruiter-ready resume in under 5 minutes - free to start.

Build My Resume Free