use window.location.href
to get the current URL
//It returns the current url of the webpage
let getCurrentUrl = window.location.href;
//get url in console
console.log("getCurrentUrl", getCurrentUrl);
Code the Future: Learn, Build, Innovate
use window.location.href
to get the current URL
//It returns the current url of the webpage
let getCurrentUrl = window.location.href;
//get url in console
console.log("getCurrentUrl", getCurrentUrl);