Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Node.js URLSearchParams.has() Method

  • Last Updated : 14 Oct, 2021

In URLSearchParams interface, the has() method returns a Boolean which tells us that if the parameter with input name exists it will return true, else false.


var Bool = URLSearchParams.has(name)

Returns: True – if name present, else it will return False.

name – Input the name of the parameter.


let url = new URL('');
let param = new URLSearchParams(;
param.has('bar') === true



Example2: When input parameter is not present

let url = new URL('');
let param = new URLSearchParams(;
param.has('foo') === true



Supported Browsers:

  • Google Chrome
  • IE
  • Edge
  • Opera
  • Apple Safari

Hey geek! The constant emerging technologies in the world of web development always keeps the excitement for this subject through the roof. But before you tackle the big projects, we suggest you start by learning the basics. Kickstart your web development journey by learning JS concepts with our JavaScript Course. Now at it's lowest price ever!

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!