Nitpick rule.
When building URLs via the URL
constructor, casting them to string seems to be obviously done via .toString
and String()
, but there's actually a native property for this.
This is generally more commonly done in TypeScript since the string
type is enforced, but many just pass the URL
instance to fetch
in JavaScript instead π¬
const url = new URL(location.origin);
console.log(url.toString())
console.log(String(url))
const url = new URL(location.origin);
console.log(url.href)
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too