Problem Statement
How would you use the URL module in Node.js?
Explanation
The URL module helps parse, resolve, and format URLs. It splits a web address into parts like hostname, path, and query parameters, making it easy to work with HTTP requests.
Code Solution
SolutionRead Only
const url=require('url');
const q=url.parse('https://example.com/home?id=10',true);
console.log(q.host, q.query.id);