syncs two javascript arrays without creating new array references