📅  最后修改于: 2022-03-11 15:02:02.303000             🧑  作者: Mango
var pathArray = "https://somedomain.com".split( '/' );
var protocol = pathArray[0];
var host = pathArray[2];
var url = protocol + '//' + host;