If I want to clone an array, I can use the slice() function, but what if I want to "clone" a single element? I want to do something like this:
array1[i] = array2[i];
but I want to copy the value, not the reference. How can I do this? Also, will the solution work for associative arrays too? For example:
array1["one"] = array2["one"];
Thank you in advance.
$.extend()