first sorry for my english
I have 2 list or 2 dic, When i write
list1 = list2
list1 become list2 and any change in list1 set in list2
How i can tranfer items from list1 to list2( without using for ) , is there any way ?
first sorry for my english
I have 2 list or 2 dic, When i write
list1 = list2
list1 become list2 and any change in list1 set in list2
How i can tranfer items from list1 to list2( without using for ) , is there any way ?
Pure javascript, do a copy
for(i=0;i<list2.length;i++) {
list1[i] = list2[i];
}
There are also shallow-clone and deep-clone copy methods in jquery and lodash/underscore. But why not just slice it?
list1 = list2.slice();