key1 ='kkk' key2 = {'11':2} if (key2 != undefined) { if (typeof key2 == 'object'){ key2 = JSON.stringify(key2) } key1 += key2 } console.log(key1)