generate functionThu, 10 Nov 2022

strip domain from url and check if exists in array $arr

var arr = ['a.com', 'b.com']; function urlStripper(url){ return url.substring(url.lastIndexOf('/') + 1); } urlStripper('http://www.a.com/'); arr.indexOf(urlStripper('http://www.a.com/'));

Javascript
Generate More

Questions about programming?Chat with your personal AI assistant