Returns the current URL.
Use window.location.href
to get the current URL.
代码片段
const currentURL = () => window.location.href;
使用样例
currentURL(); // 'https://google.com'
Returns the current URL.
Use window.location.href
to get the current URL.
const currentURL = () => window.location.href;
currentURL(); // 'https://google.com'