first_list = [1,2,3,4]
second_list = ['a','b','c']
Is there a way to merge these two arrays into a single array with two fields?
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
c = _ref[_i];
mList.push({
clients: c
});
}
for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
c = _ref2[_i];
mList.push({
projects: c
});
}
I attempted this method but it appears to only add objects to the existing array rather than creating an object item with two properties.
The current output is
Array [ Object, Object, Object, Object, Object, Object, Object ]
| | | | | | |
clients clients clients clients project project project
However, my desired outcome is :
Array [ Object, Object, Object, Object ]
| | | |
clients clients clients clients
+ + + +
projects projects projects projects (null)