📜  js 数组查找正则表达式 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:10.335000             🧑  作者: Mango

代码示例1
const array = ["page=4", "sortOrder=asc", "datePosted=all-time", "sortOrder=desc"];
const match = array.find(value => /^sortOrder=/.test(value));
// match = "sortOrder=asc"