let rank = allUsers.sort((a, b) => (b.cash - a.cash) + (b.bank - a.bank)).findIndex(e => e.user_id === target.id) + 1
const targetUser = allUsers
.find(user => user.user_id == target.id)
const targetUserMoney = targetUser.cash + targetUser.bank
let rank = 1;
for (let i = 0; i < allUsers.length; i += 1) {
if (allUsers[i].cash + allUsers[i].bank > targetUserMoney) {
rank += 1;
}
{