【发布时间】:2019-11-25 21:22:41
【问题描述】:
我有一个对象如下:
{
id: 6,
url: 'https://google.com',
title: 'abc',
actions: 63,
status: 'active',
method: 'GET',
response_type: 'json'
}
现在我想在这个对象中再推一个元素,预期的输出如下:
{
id: 6,
url: 'https://google.com',
title: 'abc',
actions: 63,
status: 'active',
method: 'GET',
response_type: 'json',
new_ele: 'new_data'
}
【问题讨论】:
-
不,这是一个简单的对象,顺便说一下@mplungjan,这不是重复的。
-
是的,它是这样的打字稿——{ id: 6, url: 'google.com', title: 'abc', actions: 63, status: 'active', method: ' GET', response_type: 'json' }
-
是的,我很确定
标签: javascript arrays node.js json typescript