Ive been trying to combine two items together on each loop, in the result there is a null, how do i check the "items" so not to get null's?
var oTitle = [],
items = ['a1', 'a2', 'b1', 'b2', 'c1', 'c2'];
for (var i=0; i < items.length; i++) {
oTitle[i] = {
one: '' + items[i], // items[i].value
two: '' + items[++i]
};
}
console.log(JSON.stringify(oTitle));
// [{"one":"a1","two":"a2"},null,{"one":"b1","two":"b2"},null,{"one":"c1","two":"c2"}]