Is this, javascript's combination algorithm, how to write an algorithm?

for example, there is such an object:

var wordList=[
{"name":"","id":1},{"name":"","id":2},{"name":"","id":3},
{"name":"","id":1},{"name":"","id":2},{"name":"","id":3},
{"name":"","id":2},{"name":"","id":1},{"name":"","id"1}
]

sources of topics and their own ideas

The function of

is to enumerate all the combinations, such as nasty 3, which means to select three of them to form a group, and all of them are enumerated.

what result do you expect? What is the error message actually seen?

but those with the same id cannot be grouped together,
nasty 3
{"name": "warm", "id": 1}, {"name": "extremely", "id": 2}, {"name": "very", "id": 3}, this is correct
{"name": "warm", "id": 1}, {"name": "ten thousand", "id": 2}, {"name": welcome,

Mar.28,2021

consider dividing it into several arrays according to id, and then taking them out from each array to combine them.


look at the wordList, you set now. If n is greater than 3, you cannot extract enough elements from the array (otherwise there must be duplicates). What effect do you need at this time? Please describe it clearly.

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-1b3e182-4f04d.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-1b3e182-4f04d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?