I'm not talking about in the URL. I know what that does. I'm talking about how it's used in actual code.
After trying to assign it as a variable, I realized that it's reserved, but I don't know what for.
An ongoing proposal (currently in stage 4) utilizes hashtags to mark fields as private. It is part of the ES2022 standard.
Example:
class Foo {
x = 1; // public field
#y = 2; // private field
add() {
return this.x + this.#y;
}
}
Javascript, or more precisely ECMAscript, is an evolving language. Some symbols and keywords (such as "class") have been reserved for future versions, even though they may not have any meaning at the moment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With