I have two different array, which i want to put in new array with key value pair.
My first array data is like
"1"
"2"
"10"
My second array data
"1"
"2"
"3"
I want array like this
[{ICDID:1,MappingId:1},
{ICDID:2,MappingId:2},
{ICDID:10,MappingId:3}]
var mapidicd = mappingicdcodes.split(',');
var ICDMappings = new Array();
ICDMappings = $("#updateddlicdcode").val();
var ICDMapping = [];
$.each(ICDMappings, function (i, value) {
ICDMapping.push({ 'ICDID': value });
});
$.each(mapidicd, function (i, value) {
ICDMapping.push({ 'MappingId': value });
});
i have tried to put something like that but unable to get desired output.