query string parameter code example

Example 1: get parameters from url

var url_string = "http://www.example.com/t.html?a=1&b=3&c=m2-m3-m4-m5"; //window.location.href
var url = new URL(url_string);
var c = url.searchParams.get("c");
console.log(c);

Example 2: query parameters

Query Parameter 
		represented as  key value pair right after the ? 
		https://www.google.com/search?q=iloveyou
	usually used to filter the result
    
    GET /api/spartacus/search?gender=Male&nameContains=li
	if we have more than one query parameter 
		& is used to connect them 
        
 Also there is a Path Parameter|variable
	/api/spartans/{id}  /api/spartans/:id 
	It's used to identify single resource amonth list of resources
	in above example 
		the id is the path parameter to identify single spartan