Array takes the same object and accumulates

there are duplicate values under an array. You want to calculate the accumulations of the same values
such as: var arr = [{id: 1}, {id: 2}, {id: 3}, {id: 1}, {id: 1}]

.

the value you want to return is [{id: 1} * 3 , {id: 2}, {id: 3}]

Please ignore the syntax of * 3, just hope to achieve this effect. Now ask for good solutions.

say the required case: multiple projects, the project may have the same value. If you have one, you will synthesize one. And give the project synthesis times of the same value ()?

Sep.17,2021

   

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e64c52-45263.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e64c52-45263.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?