UNPKG
@sgratzl/science
Version:
latest (2.0.0)
2.0.0
Scientific and statistical computing in JavaScript.
github.com/sgratzl/science.js
sgratzl/science.js
@sgratzl/science
/
src
/
core
/
zeroes.js
16 lines
(15 loc)
•
336 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* Constructs a multi-dimensional array filled with zeroes. */
export
default
function
zeroes
(
n
) {
var
i = -
1
, a = [];
if
(
arguments
.
length
===
1
)
while
(++i < n) a[i] =
0
;
else
while
(++i < n) a[i] = zeroes.
apply
(
this
,
Array
.
prototype
.
slice
.
call
(
arguments
,
1
));
return
a; };