I have a variable as var input = 'promojam-untitled-promotion-2'; and an array
var prefferedPatterns = [
"https://promojam.live.promojam.dev:5000/promojam-untitled-promotion-2",
"http://promojam.live.promojam.dev:5000/promojam-untitled-promotion-3",
"http://promojam.live.promojam.dev:5000/promojam-untitled-promotion-4",
"http://promojam.live.promojam.dev:5000/promojam-untitled-promotion-5",
"http://promojam.live.promojam.dev:5000/promojam-untitled-promotion-6",
"http://promojam.live.promojam.dev:5000/promojam-untitled-promotion-7",
"http://promojam.live.promojam.dev:5000/promojam-untitled-promotion-8",
"http://promojam.live.promojam.dev:5000/promojam-untitled-promotion-9"
]
I have to find the matched input element from this array. any idea ?
for,indexOf,filter, RegEx, ...