I have a variable like,
var url = "/login/user";
And I have an array like,
var x = ["login", "resetpassword", "authenticate"];
Now I need to check, whether that url string is present in an array of string. As we can see that login is present in an array but when i do x.indexOf(url), it always receive false because the field url has rest other letters also. So now how can I ingnore those letters while checking a string in an array and return true?