Answers for "js get url static without path from strin"

0

js get url static without path from strin

var pathArray = "https://somedomain.com".split( '/' );
var protocol = pathArray[0];
var host = pathArray[2];
var url = protocol + '//' + host;
Posted by: Guest on February-06-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language