Finding User's division
Finds the division to which a user belongs based on their rating.
const RankSystem = require('division-rank');
// Assuming rankSystem is already instantiated with divisions
const user = {
id: 1,
rating: 500
};
try {
const division = rankSystem.findUserDivision(user);
console.log(division); // Output: 'Silver' (based on the example provided)
} catch (error) {
console.error(error.message);
}Last updated