Logo

Programming-Idioms

History of Idiom 27 > diff from v28 to v29

Edit summary for version 29 by programming-idioms.org:
Admin deletes impl 2326

Version 28

2018-05-21, 23:18:09

Version 29

2018-08-05, 12:27:35

Idiom #27 Create a 3-dimensional array

Declare and initialize a 3D array x, having dimensions boundaries m, n, p, and containing real numbers.

Illustration

Idiom #27 Create a 3-dimensional array

Declare and initialize a 3D array x, having dimensions boundaries m, n, p, and containing real numbers.

Illustration
Code
var x = 
    [].fill(
        [].fill(
            [].fill(0, 0, p),
            0,
            n
        ),
        0,
        m
    );
Doc URL
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill