CodeHS 8.1.5: Manipulating 2D Arrays , you are tasked with fixing the final element (currently set to 0) in each sub-array of a 2D array. This exercise tests your ability to access specific indices and calculate values based on existing array properties like You must call a method (often named updateValue
Adding a new row to a 2D array can be done using the push() method. Codehs 8.1.5 Manipulating 2d Arrays
matrix.lengthmatrix[0].lengthTo update an element in a 2D array, you can simply assign a new value to the element using its row and column index. CodeHS 8
Here is how you would write the solution for a typical manipulation task: Number of rows: matrix
In CodeHS 8.1.5, you learned to: