如何用 javascript 实现多字段模糊查询
数组如下
```
var arr = [
    {id: "1", en: "Afghanistan", cn: "阿富汗", code: "93"},
    {id: "2", en: "Iraq", cn: "伊拉克", code: "964"},        
    {id: "3", en: "Qatar", cn: "卡塔尔", code: "974"}
    ]
```
en,cn,code都能查询
比如输入`aq`，查询返回第二条
比如输入`卡`，查询返回第三条
比如输入`97`，查询返回第三条
```
function query(arr, q) {
  return arr.filter(v => Object.values(v).some(v => new RegExp(q + '').test(v))
  )
}
```