Welcome! This is a small script written in JavaScript by a learner. It is the checkout backend code for a supermarket app. The user interface will be added subsequently. It is also a work in progress and could do with a lot of refactoring and cleaning up. The parts commented out are left as is to elicit comments and suggestions.
The implementation uses arrays where objects could have worked equally well, I suppose. I reckon though that arrays (auto-indexed objects) are several times faster than custom-key objects. The difference in space complexities, I understand is negligible. Feel free to tear me (my decision) apart.
Contributions are welcome, especially from @github/lassbon.