Thomas Juster
Jan 8, 2021

--

Indeed, a plain JS would have suffice. Any data type holding a reference would have suffice actually, either an empty object, array, set, map … or even an existing object: using window (or now globalThis) as a default value would do the trick !

Here I found the `symbol` to be the most elegant way, which is of course deeply subjective.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Thomas Juster
Thomas Juster

Written by Thomas Juster

Front-end Developer; I‘m not sure who I am.

No responses yet

Write a response