Sid*_*ath 1 arrays sorting reactjs
我有一个数据数组,我需要将这些数据过滤到 React js 中的变量中。
这是我的数组
[{idappcontent: "Com_01", idcontenttype: "0", idclient: "5"},
{idappcontent: "Com_02", idcontenttype: "0", idclient: "5"},
{idappcontent: "Com_03", idcontenttype: "0", idclient: "5"},
{idappcontent: "Review1_Ques_01", idcontenttype: "0", idclient: "5"},
{idappcontent: "Review1_Ques_02", idcontenttype: "0", idclient: "5"},
{idappcontent: "Sign_01", idcontenttype: "0", idclient: "5"},
{idappcontent: "Sign_02", idcontenttype: "0", idclient: "5"},
{idappcontent: "Thank_01", idcontenttype: "0", idclient: "5"},
{idappcontent: "Thank_02", idcontenttype: "0", idclient: "5"}
]
Run Code Online (Sandbox Code Playgroud)
我需要获取包含“idappcontent ==”Sign_“”的数据。如何过滤与“Sign_”字符串匹配的数组数据?
用这个:
const temp = YOURDATA.filter(item=> item.idappcontent.includes("Sign_"));
Run Code Online (Sandbox Code Playgroud)
欲了解更多信息:
| 归档时间: |
|
| 查看次数: |
2147 次 |
| 最近记录: |