Computer scienceBackendNode.jsCore ConceptsInternal modulesHTTP server

Intro to URL module

Construct personalized url

Report a typo

Complete the code below to construct a URL with the protocol — https:, hostname — www.example.com, port 443, and pathname — /mydocument.

Do not print the constructedURL, testing is handled internally. The url module is already imported using the require method and is stored in a const url variable.

Sample Input 1:

Sample Output 1:

https://www.example.com:443/mydocument
Write a program in JavaScript
// Construct the URL here
...

// Constructed URL

const constructedURL = ...
___

Create a free account to access the full topic