//URLをとる
new URL(“http://test.co.jp/aaa”).getHost();
→http://test.co.jp/
new URL(“http://test.co.jp/aaa”).getPath();
→aaa
ドメイン(ホスト)を取得する方法

//URLをとる
new URL(“http://test.co.jp/aaa”).getHost();
→http://test.co.jp/
new URL(“http://test.co.jp/aaa”).getPath();
→aaa