How to check if query parameters name exists in URL with JavaScript

1 Answer

0 votes
const URLParams= "?client=firefox-b-f&biw=324";

const params = new URLSearchParams(URLParams)

console.log(params.has("client"));
console.log(params.has("id"));
  


    
/*
run:
    
true
false
    
*/

 



answered Feb 24, 2021 by avibootz
edited Feb 24, 2021 by avibootz

Related questions

1 answer 186 views
1 answer 247 views
1 answer 126 views
2 answers 173 views
3 answers 272 views
1 answer 173 views
173 views asked Aug 7, 2020 by avibootz
1 answer 125 views
...