如果两个值都不存在,如何推入数组?这是我的数组:
[
{ 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()
我怎样才能做到这一点?