I have several sets that I am trying to combine in a specific order. For example, let's say I have three arrays:
var arrayOne = [1a, 1b, 1c];
var arrayTwo = [2a, 2b, 2c];
var arrayThree [3a, 3b, 3c];
how do i get something like this?
var combinedArray = [1a, 2a, 3a, 1b, 2b, 3b, 1c, 2c, 3c]
EDIT
Well, I'm going to add a little more to my story here, since I have excellent answers and answers from everyone. Maybe it will be clearer. I have a SharePoint list from which I get all my information. I use SPServices to get my data from a list. I also get the version history of each item in the list and putting them in arrays, so I can pull the data from the SPServices cycle and use it outside of the SharePoint stuff, so I can try to order and display it the way I want. (Please do not move this to SharePoint ). This should all happen at runtime. So, here is the first part. I declare global variables for each of my list items:
var proModified6 = new Array();
var proHistory = new Array();
var assignedTo = new Array();
var startDate = new Array();
var endDate = new Array();
var status = new Array();
var project = new Array();
var history = new Array();
var listItems = new Array();
var regex = new RegExp("");
var i = 0;
Then I populate arrays with SharePoint list information (I'm not going to put them all, but everyone has a call like this)
$().SPServices({
operation: "GetVersionCollection",
async: false,
webURL: "http://devchrisl01/test",
strlistID: "NewProjects",
strlistItemID: proID[i],
strFieldName: "Title",
completefunc: function (xdata, Status) {
$(xdata.responseText).find("Version").each(function() {
var xitem = $(this);
var ID = xitem.attr('ID');
var Project = xitem.attr('Title');
var Modified = xitem.attr('Modified').split('T')[0];
var ModifiedTime = xitem.attr('Modified').substring(11, 19);
project.push(Project);
proModified2.push(Modified + ModifiedTime)
var data = "<tr><td><b>" + Modified + " " + ModifiedTime + "</b></td><td>" + Project + "</td></tr>";
$('#versionList'+i+'').append(data);
});
}
});
. . SPServices, , . : , . , . (PAIN IN THE ASS ), :
var modifiedDate = [proModified1, proModified2, proModified3, proModified4, proModified5, proModified6];
var projectHistory = [history];
var projectTitle = [project];
var projectAssignedTo = [assignedTo];
var projectStartDate = [startDate];
var projectEndDate = [endDate];
var projectStatus = [status];
. . , . : 0
, ? , lol.