Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
mschuster91
6 months ago
|
parent
|
context
|
favorite
| on:
Plain Vanilla Web
From
https://plainvanillaweb.com/pages/components.html
I see this piece:
if (!this.#span)
What is
that
kind of magic syntax sugar?! A shorthand for document.getElementById?
jbreckmckye
6 months ago
[–]
No, the hash is a red herring. It's a way of signifying a private field on an object.
mschuster91
6 months ago
|
parent
[–]
Ah. Thanks, that hint pointed me to [1]. Seems like it's been supported by every major browser since 2021, and only specified in the upcoming ECMAScript 2026 spec.
[1]
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
jbreckmckye
6 months ago
|
root
|
parent
[–]
It has a contentious history and largely was forced through by one person in TC39 who focused on a particular corner case
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: