Storing items of an array depending on another value

后端 未结 2 1578
遥遥无期
遥遥无期 2021-01-20 16:37

I have an array called catalogue which holds 4 items:

packageid, dataid , categoryid and datapackage.

What I want to do is push into the array datai

2条回答
  •  情歌与酒
    2021-01-20 17:10

    I assume your condition should be something like

    if ((packageBtnFilter == 0 && categoryBtnFilter == 0) || this.packageid == packageBtnFilter || this.packageid == categoryBtnFilter) dataids.push(this.dataid);
    

提交回复
热议问题