Function of: if(/(file|http).*/.test(url)) { }
- by WmasterJ
I am wondering what this technique is called and what it does. It seems to be validating some regular expression on the variable url. I am customizing another persons code:
var url = document.getElementById("editorURL").value;
if(/(file|http).*/.test(url)) {
}
Maybe someone has a link to an article that explains this a bit more in-depth?