9
typescript怎么动态给object添加属性?
source link: https://www.zhihu.com/question/465336030/answer/1943335002
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
typescript怎么动态给object添加属性?
登录后你可以
不限量看优质回答私信答主深度交流精彩内容一键收藏
永远年轻的伪全栈码农
const a : Record<string, string> = {}
a.p1 = “hello”
enjoy!
继续浏览内容
发现更大的世界
Chrome
more interest, less interests
ts是一个静态的类型检查系统,给对象添加属性,属于JS的范畴,JS如何添加属性,在TS中也是一样的。详细的TS的文章,可以关注我的CSDN,我有一个模块专门记录了自己在学习TS的笔记。https://blog.csdn.net/qq_41499782
继续浏览内容
发现更大的世界
Chrome
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK