Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript fill 2d array

const r = 4;
const c= 3;
const a = new Array(r).fill(new Array(c).fill(-1));
 
PREVIOUS NEXT
Tagged: #javascript #fill #array
ADD COMMENT
Topic
Name
9+2 =