let arr = ["1", "2", "3", "4","5"] let s='' let obj = arr.reduce ((o, v) => (s=s? s+'.'+v: v , o['col_'+v] = s, o), {}); console.log(obj);