Skip to main content
property URL.username

The username property of the URL interface is a string that represents the username of the URL.

Examples

Example 1

const myURL = new URL('https://someone:somepassword@example.org/baz');
console.log(myURL.username);  // Logs "someone"

Type

string

See

Back to top