Gets and sets the password portion of the URL.
const myURL = new URL('https://abc:[email protected]');
console.log(myURL.password);
// Prints xyz
myURL.password = '123';
console.log(myURL.href);
// Prints https://abc:[email protected]/
Invalid URL characters included in the value assigned to the password
property are percent-encoded
. The selection of which characters to percent-encode may vary somewhat from what the parse and format methods would produce.