function doAdd(str) { var arr = JSON.parse(str); !arr['param3'] && (arr['param3'] = []) arr['param3'].push({ subparam1: 'vol1', subparam2: 'vol2' }); return JSON.stringify(arr); } alert(doAdd('{"param1":"value1","param2":"value2"}'))