let json = {'1':1,"2":'2','3':3,"4":4}
// 先将json对象转为json字符串,再替换你要替换的属性名,最后再转为json对象
json = JSON.parse(JSON.stringify(json).replace(/1/, "titlea"));
json = JSON.parse(JSON.stringify(json).replace(/2/, "titleb"));
json = JSON.parse(JSON.stringify(json).replace(/3/, "titlec"));
json = JSON.parse(JSON.stringify(json).replace(/4/, "titled"));
**结果转换为json对象了**
console.log(json)
{"titlea":5,"titleb":10,"titlec":15,"titled":30}
let temp = JSON.parse(json)
**//转换成js对象了**
console.log(temp)
{titlea: 5, titleb: 10, titlec: 15, titled: 30}