How to use the dotaconstants.xp_level function in dotaconstants

To help you get started, we’ve selected a few dotaconstants examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github odota / core / public / js / generateCharts.js View on Github external
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;
}
github odota / core / public / js / generateCharts.js View on Github external
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;
}