UNPKG
brush_cli
Version:
latest (0.0.2)
0.0.2
0.0.1
A tool for creating and developing cmos PC Framework project.
brush_cli
/
node_modules
/
shallow-copy
/
example
/
array.js
10 lines
(7 loc)
•
182 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
var
copy =
require
(
'../'
);
var
xs = [
3
,
4
,
5
, {
f
:
6
,
g
:
7
} ];
var
dup =
copy
(xs); dup.
unshift
(
1
,
2
); dup[
5
].
g
+=
100
;
console
.
log
(
'original: '
, xs);
console
.
log
(
'copy: '
, dup);