projects
/
xogo.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
Add a few variants
[xogo.git]
/
utils
/
array.js
1
export const
ArrayFun
= {
2
3
// Double array intialization
4
init
:
function
(
size1
,
size2
,
initElem
) {
5
return
[...
Array
(
size1
)].
map
(() =>
Array
(
size2
).
fill
(
initElem
));
6
},
7
8
range
:
function
(
max
) {
9
return
[...
Array
(
max
).
keys
()];
10
}
11
12
};