📅  最后修改于: 2022-03-11 15:01:39.191000             🧑  作者: Mango
const url = 'http://www.youtube.com/watch?v=ClkQA2Lb_iE';
const { hostname } = new URL(url);
console.assert(hostname === 'www.youtube.com'); // true