Recherchez un tableau avec un index javascript regex

const array = ["page=4", "sortOrder=asc", "datePosted=all-time", "sortOrder=desc"];
const index = array.findIndex(value => /^sortOrder=/.test(value));
// index = 1;
Akmal Arzhang