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