摘要: var arr = [ 'Car', 'Car', 'Truck', 'Boat', 'Truck' ]; var hist = {}; arr.map( function (a) { if (a in hist) hist[a] ++; else hist[a] = 1; } ); console 阅读全文
posted @ 2020-11-26 18:14 xdsax 阅读(1116) 评论(0) 推荐(0) 编辑