Loading...

Jammie Mountz

Software Engineer

Javascript Object Instantiation Patterns

These patterns all achieve the goal of creating an instance – a new object – that has standard properties/methods.

There’s plenty of visual aids, but this one I made and it is mine. Ignore my momentary lack-of-patience with design principles – the information is what is important.

In the diagram, I explore the differences between functional, functional shared, prototypal, and pseudoclassical instantiation patterns. Pseudoclassical is optimized for the browser and is most likely to perform better because of that, so I’ll probably tend towards that style when using instantiation in the future.

four_instantiations

Fluent in Spanish and JavaScript, salsa dancer, lover of material design.

Living in San Francisco, CA