如果两个值都不存在,如何推入数组?这是我的数组:
[
{ name: "tom", text: "tasty" },
{ name: "tom", text: "tasty" },
{ name: "tom", text: "tasty" },
{ name: "tom", text: "tasty" },
{ name: "tom", text: "tasty" }
]
name: "tom"
如果我尝试使用or再次推入数组text: "tasty"
,我不希望发生任何事情......但如果这些都不存在,那么我希望它.push()
我怎样才能做到这一点?