/    Sign up×
Community /Pin to ProfileBookmark

help – combining arrays

How can I combine the data from these two arrays into a new Array (AR4) that will have this format (i, pWTL, idR, pWTL, rSM)?

After combining would AR4 be considered a multi-dimensional array?

var AR2=new Array();
do
{
var AR1=new Array(i, pWTL);
AR2.push(AR1);
i++;
var pWTL=((lbIN*i) + l);
l=pWTL;
}
while (i<=y);
AR2.reverse();
for(j in AR2){
}

do
{
var AR3=new Array(idR, pWTR, rSM);
idR++;
var pWTR=((lbIN*idR)+r);
r=pWTR;
var bWT=(idR*
a)
var rSM=(bWT + pWTR);
}
while (idR<=y);

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@FangNov 30.2005 — var AR4=AR1.concat(AR3); not multidimensional
Copy linkTweet thisAlerts:
@edp1959authorNov 30.2005 — Where should I put this code in order to capture all of the data from both AR1 and AR3?

Putting it here gets all of the rows from AR3 but only the last row from AR1:

do

{

var AR3=new Array(idR, pWTR, rSM);

var AR4=AR1.concat(AR3);

idR++;

var pWTR=((lbIN*idR)+r);

r=pWTR;

var bWT=(idR*
a)

var rSM=(bWT + pWTR);

}

while (idR<=y);
Copy linkTweet thisAlerts:
@FangNov 30.2005 — I would suggest after the do..while loops
×

Success!

Help @edp1959 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...