DEV Community

Discussion on: You decide the new features!

Collapse
 
jzombie profile image
jzombie

You could add unit tests.

--- some opinions below

Second to that, you might gain performance benefit if you use Map (developer.mozilla.org/en-US/docs/W...) instead of your class.

You could still keep the API the same while having a more "native" backend w/ the Map usage.

If you do retain the class usage, I'd useJS classes, as it can be more easily extended with other functionality in the future.

Collapse
 
jzombie profile image
jzombie • Edited

You can also extend the "native" Map type (i.e. class StructMap extends Map) with a custom class for your needs.

If doing that, I'd highly recommend TypeScript because it will help you avoid returning the wrong types in your methods.