React JS:用字符串过滤数组

Nic*_*app 6 arrays string filter typescript reactjs

这是我,现在与.

我有一个,里面有两个"行",它们是Descriptionubication.我需要过滤数组Description.

我该如何过滤?它以文本格式描述,例如"Impact""Wiu wiu".

我知道函数filter()有一个数字的条件,但不具有文本条件或者我还没有看到它被使用为.

非常感谢你的帮助.

Saj*_*ran 6

您仍然无法同时使用文字,

let filtered = yourArray.filter(t=>t.Description ==='impact');
Run Code Online (Sandbox Code Playgroud)

DEMO

let filtered = yourArray.filter(t=>t.Description ==='impact');
Run Code Online (Sandbox Code Playgroud)