How to use the chunk function from underscore
Find comprehensive JavaScript underscore.chunk code examples handpicked from public code repositorys.
160 161 162 163 164 165 166 167 168 169
api_key: challonge_config.api_key }, validateStatus: () => true, }); sendResponse("开始上传玩家列表至 Challonge。"); for (const chunk of _.chunk(player_list, 10)) { sendResponse(`开始上传玩家 ${chunk.join(', ')} 至 Challonge。`); await axios.post(`https://api.challonge.com/v1/tournaments/${challonge_config.tournament_id}/participants/bulk_add.json`, { api_key: challonge_config.api_key, participants: chunk.map(name => ({ name })),
0
0
0
underscore.keys is the most popular function in underscore (11266 examples)