JSFiddle - React, Tailwind, and code Playground
JavaScript
let x = {};
let arr = 'D:H:I'.split(':');
var keys = ["a", "b", "c", "d"];
var val = "Hello";
var res = keys.reduceRight((value, key) => ({[key]: value}), val);
console.log(res);
/* .forEach((item, index) => {
}); */