Logo

Programming-Idioms

History of Idiom 26 > diff from v44 to v45

Edit summary for version 45 by devbg:
New JS implementation by user [devbg]

Version 44

2018-08-05, 12:06:47

Version 45

2018-11-09, 14:07:44

Idiom #26 Create a 2-dimensional array

Declare and initialize a matrix x having m rows and n columns, containing real numbers.

Illustration

Idiom #26 Create a 2-dimensional array

Declare and initialize a matrix x having m rows and n columns, containing real numbers.

Illustration
Code
const x = new Array(m).fill(new Array(n).fill(Math.random()));