javascript - 打字稿更新对象内的项目
问题描述
假设我有这个对象:
info: {
firstName: Joe,
lastName: Smith,
userName: jsmith
}
然后通过一个函数,我想只更新 info 中的 userName ,因为他userName
是 now jsmith1
。我将如何去做这样的事情?
假设我有这个对象:
info: {
firstName: Joe,
lastName: Smith,
userName: jsmith
}
然后通过一个函数,我想只更新 info 中的 userName ,因为他userName
是 now jsmith1
。我将如何去做这样的事情?
标签: javascripttypescript