Array copy Javascript
Copying a whole array into a new one:
> var a = [1,2,3,4,5,6]; var b = a.slice();
> b
[ 1,
2,
3,
4,
5,
6 ]
Written by Johannes Boyne
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Javascript
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#