使用github端点https://api.github.com/users/,我想将json响应复制到具有相同键的javascript对象中,有没有比逐行使用oject变量赋值更好的方法? ?
示例 json 响应
{
"login": "imukunya",
"name": null,
"company": null,
"blog": "",
"location": null,
"email": null,
"hireable": null,
"bio": null,
"twitter_username": null,
"public_repos": 19,
"public_gists": 0,
"followers": 0,
"following": 0,
"created_at": "2020-04-28T07:14:15Z",
"updated_at": "2020-11-06T04:20:24Z"
}
JavaScript 对象
userProfile = {
"login": "",
"name": ,
"company": ,
"blog": "",
"location":"" ,
"email": "",
"hireable": "",
"bio": "",
"twitter_username": "",
"public_repos": 0,
"public_gists": 0,
"followers": 0,
"following": 0,
"created_at": "",
"updated_at": ""
}
蝴蝶刀刀
相关分类