最适合我的柜台?一个对象或简单对象?
我需要跟踪并显示使用价格点多少次,例如:“ 15美元(2个选项)”,鉴于我需要显示价格和计数并增加计数时间以给定价格添加了新的选项,我是否应该使用:
或以下:
注意:不要注意字段名称“ array”和“ Object-priceCount”,这仅是用于测试目的。<<<<<<<<<<<<<< /em>
I need to keep track of and display how many times a price point is being used, e.g.: "$15 (2 options)" Given that i need to display the price and the count and increment the count each time a new option is added at the given price, should I go with:
or this:
Note: do not pay attention to the field names "array" and "object-priceCount", this is for testing purposes only.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
实际上,我会保留这些计数器的地图,以便您可以更新个人计数器:
I'd actually keep a map for these counters, so that you can update an individual counter with: