You can get the value of a GET parameter in the URL using URLSearchParams
.
Example:
const urlParams = new URLSearchParams(window.location.search);
const value = urlParams.get('param');
console.log(value); // Logs the value of 'param' from the URL
Tags: intermediate, JavaScript, URL manipulation
URL: https://www.tiktok.com/@jsmentoring/photo/7467643182990249249