JSFiddle - React, Tailwind, and code Playground
JavaScript
var arraySource = [];
arraySource.push({key : "fr", value: "france"});
arraySource.push({key : "es", value: "spain"});
//...
console.debug(arraySource);
var destJson = {};
$.each(arraySource, function (index, item) {
destJson[item.key] = item.value;
});
console.debug(destJson);