jmsv / oaty

Object Array Transposer(y) - JS objects with multiple key/value structures
https://www.npmjs.com/package/oaty
MIT License
10 stars 0 forks source link

Use prototype internal methods #10

Open jmsv opened 5 years ago

jmsv commented 5 years ago

At the moment, OatyArray is built as a class with internal methods, but to match Array it should be a function with OatyArray.prototype methods, e.g. OatyArray.prototype.push(). This has benefits, such as that all OatyArray instance methods are references to the prototype implementation.

This post does a great job of explaining how prototypes work and how to implement them.

j-m commented 5 years ago

Is this not a duplicate of #4 ?