來自:https://segmentfault.com/q/1010000011923504 侵刪 將其中的CourseName更改為title 修改成功! ...
來自:https://segmentfault.com/q/1010000011923504 侵刪
[ { "Id":"3972679ef2c04151972b376dd88e6413", "T_CourseId":"7a4494aae1804d3e94094583249750fe", "CourseName":"英語", "Code":"english" }, { "Id":"5665d803e7994b26a56c6287d12c2090", "T_CourseId":"75761ad2ce23498c9f9db134ab844aec", "CourseName":"藥物化學", "Code":"ywhx" } ]
將其中的CourseName
更改為title
var aaa = [ { "Id":"3972679ef2c04151972b376dd88e6413", "T_CourseId":"7a4494aae1804d3e94094583249750fe", "CourseName":"英語", "Code":"english" }, { "Id":"5665d803e7994b26a56c6287d12c2090", "T_CourseId":"75761ad2ce23498c9f9db134ab844aec", "CourseName":"藥物化學", "Code":"ywhx" } ] var bbb= JSON.parse(JSON.stringify(aaa).replace(/CourseName/g,"title")); console.log(bbb)
修改成功!