Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Self Hosted Array Supporting Private State
class X {
constructor(len) {
let target = Object.create(;
let handler = {
// handler stuff - special logic for "length" and integer properties
// Otherwise, use target's properties
return Reflect.construct(Proxy, [target, handler],;
class Y extends X {
constructor() {
get foo() { return this.#foo }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.