typescript URLSearchParams code example
Example 1: generate query string from urlsearchparams
URLSearchParams.toString()
Example 2: typescript read url search params
const product = urlParams.get('product')
console.log(product);
// shirt
const color = urlParams.get('color')
console.log(color);
// blue
const newUser = urlParams.get('newuser')
console.log(newUser);
// empty string