Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Prototype mutability wip

Object or Function prototype mutability is unintuitive, like a key that returns a different letter on each keypress. This points to one of the reasons why patterns like virtualization via proxies and reflection, functional programming's eschewal of side effects, and reactive vue-style object mutation events are commonly used, especially in conjunction with composition techniques.

That is, we expect Function.prototype.apply to invoke a function given context and an array of parameters. We can easily change the method - Function.prototype.apply = ( fn ) => { console.log( fn ) } - it is expectations that are difficult to change.

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.