var url = 'https://xzdx.xyz/';
var cut = url.substring(url.lastIndexOf(".")+1);
console.log(cut);
打印出来的是 xyz
lastIndexOf 用法:https://www.runoob.com/jsref/jsref-lastindexof-array.html
substring 用法:https://www.runoob.com/jsref/jsref-substring.html