Skip to content

Instantly share code, notes, and snippets.

@projektorius96
Created July 27, 2022 08:37
Show Gist options
  • Save projektorius96/086921fd379f94d54ef1287c14ce5a25 to your computer and use it in GitHub Desktop.
Save projektorius96/086921fd379f94d54ef1287c14ce5a25 to your computer and use it in GitHub Desktop.
#1 shared on linkedin
let obj = Object.create(null) // prototypeless object
/* obj.propKey = propValue; */// prototypeless also means constructorless, resulting in the term of "singleton"
let isInstance = new obj
console.log(isInstance) // TypeError: obj is not a constructor – that's what you suppose to expect
// ===
// NOTE : constructorless can be prototype-based, but not vise versa with regards to example shown above !
// For more read about : @https://dev.to/projektorius96/constructorless-namespaces-in-es5-es6-14pk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment