Skip to content

Instantly share code, notes, and snippets.

View talk2sohail's full-sized avatar
💭
Looking for Job opportunities.

Md Sohail talk2sohail

💭
Looking for Job opportunities.
  • Software Engineer
  • India
View GitHub Profile
@getify
getify / 1-CalendarItem.js
Last active March 21, 2024 09:11
an illustration (non-trivial example) of many newer JS class features
// abstract class, not intended to be instantiated directly
class CalendarItem {
static #UNSET = Symbol("unset")
static #isUnset(v) {
return v === this.#UNSET;
}
static {
for (let [idx,msg] of [
"ID is already set.",
"ID is unset.",