Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function getLevelFromXp(xp) {
for (var i = 0; i < constants.xp_level.length; i++) {
if (constants.xp_level[i] > xp) {
return i;
}
}
return constants.xp_level.length;
}
function getLevelFromXp(xp) {
for (var i = 0; i < constants.xp_level.length; i++) {
if (constants.xp_level[i] > xp) {
return i;
}
}
return constants.xp_level.length;
}