ud2
ud2
DDeno
Created by Warlockk on 4/23/2024 in #help
Is this correct for Javascript?
I recommend checking out the Web Platform Design Principles, especially the section on overloading.
11 replies
DDeno
Created by Bairdy on 1/29/2023 in #help
prototype dot functions. How?
If https://github.com/tc39/proposal-call-this eventually gets implemented, you might be able to write
function toUSD() {
return new Intl.NumberFormat("en-US", {
style: "currency",
currency: "USD",
}).format(this);
}

2~>toUSD() // returns $2.00
function toUSD() {
return new Intl.NumberFormat("en-US", {
style: "currency",
currency: "USD",
}).format(this);
}

2~>toUSD() // returns $2.00
3 replies