Answers for "javascript array column"

0

javascript array column

//get column in javascript... 

	function getCol(matrix, col){
       var column = [];
       for(var i=0; i<matrix.length; i++){
          column.push(matrix[i][col]);
       }
       return column; // return column data..
    }

    var array = [new Array(20), new Array(20), new Array(20)]; //..your 3x20 array
    getCol(array, 0); //Get first column
Posted by: Guest on May-10-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language