🚨🚨🚨 Interested in what all the hype with @remix_run is about?
Join @ralex1993 as he dives into it LIVE including topics like caching, styling, authentication and cookies, nested routes, and more!
Starting 👉 now 👈.
piped.video/watch?v=Kwijy7be…
📅 New Event (and it's a cool one)!
"How Forbidden Planet Cured My Imposter Syndrome" by @knitcodemonkey
Thursday November 12th, 12PM PDT
ui.dev/events/
We can leverage the this keyword to figure out which instance invoked the method. For push, we need to add the element to the end of our "array" and then return the new length.
Now we need to implement push, pop, and filter. Since we want these to be shared across all instances of array, we're going to put them on array.prototype.
array needs to return an object with a length property that delegates to array.prototype.
Since we don't want length to be enumerable, we can create it with Object.defineProperty.
It’s a little weird to have an object with numerical keys (since that’s literally what an array is for), but it paints a good picture that arrays really are just fancy objects. With this in mind, we can take the first step for creating our array function.