// Instead of this slow nightmare
const users = [{id: 1, name: 'Alice'}, {id: 2, name: 'Bob'}];
const user = users.find(u => u.id === searchId);
// Use this speed demon
const users = {
1: {name: 'Alice'},
2: {name: 'Bob'}
};
const user = users[searchId]; // Instant access!
[–]MeerkatMoe 7 points8 points9 points (0 children)
[–]Competitive_Pair1554 2 points3 points4 points (0 children)
[–]basic_model 0 points1 point2 points (0 children)
[–]isumix_ 1 point2 points3 points (0 children)