In URLSearchParams interface, the values() method returns an iterator which allows us to iterate through all the values present in the object
Syntax:
searchParams.values();
Return: Returns an ES6 Iterator over the values of each name-value pair.
Example 1:
// Create a test URLSearchParams object var searchParams = new URLSearchParams("keyA=valueA&keyB;=valueB"); // Display the values for(var value of searchParams.values()) { console.log(value); } |
chevron_right
filter_none
Output:
valueA valueB
Example 2: To create parameters directly
// Create a test URLSearchParams object var searchParams = new URLSearchParams("name=deepak&age=18"); // Display the values for(var value of searchParams.values()) { console.log(value); } |
chevron_right
filter_none
Output:
deepak 18
Supported Browsers:
- Google Chrome
- IE
- Edge
- Opera
- Apple Safari
Recommended Posts:
- How to resolve 'node' is not recognized as an internal or external command error after installing Node.js ?
- Node.js vs Vue.js
- Node js | OS
- Node.js | os.EOL
- Why Node.js ?
- Node.js vs Java
- Node.js | EventEmitter
- Node.js | Frameworks
- Node.js | Web Server
- Node.js | Buffers
- Node | URL.protocol API
- Node.js | First Application
- What is Chaining in Node.js ?
- Node.js | Basics
- Node.js | Console
- Node | URL.domainToUnicode
- Node | URL.fileURLToPath API
- How to use Sequelize in Node.js ?
- Node | URL.host API
- Node.js | Debugging
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

