Hi,
does anyone know the simplier way in JS to merge two arrays then doing it row by row? The simple arrays like the ones with txt data from text areas.
regards
Artur
Hi,
does anyone know the simplier way in JS to merge two arrays then doing it row by row? The simple arrays like the ones with txt data from text areas.
regards
Artur
the concat method should work for this.
What exacatly do you ant to merge?
The contents of Arrayelemts or something like Array1+=Array2 ??
Hi,
I have two fields - both as arrays. I want to merge them in one variable.
With calculations it is easy: $var1 + $var2
but in JS I had to finally do the row by row:
var1.push(a[i]);
I wanted something else to make it faster.
Nothing worked well, except push()
regards
Artur
You mean something like that?
Code:var a = [1,2,3]; var b = [4,5,6]; a = a.concat(b);
Of course, the best way in SC/SM would be using system.functions.insert()
but pure JS works OK.
BTW, speaking about "faster", the code you wrote - in SC/SM terms -
is as fast as Array.concat(), so no worries there.
Last edited by mateuszk; 2009-03-13 at 21:08.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks