I have an array of objects a=[ {v:0}, {v:1}, {v:2}, {v:3} ] ;
a=[ {v:0}, {v:1}, {v:2}, {v:3} ] ;
I do not have the index into the array, but I do have references to>
Here is a one liner, just in case:
a.splice(a.indexOf(s2), 1, a.splice(a.indexOf(s1),1,s2)[0]);