MCPcopy Create free account
hub / github.com/codecombat/codecombat / ageToBracket

Function ageToBracket

app/core/utils.js:1383–1392  ·  view source on GitHub ↗
(age)

Source from the content-addressed store, hash-verified

1381}
1382
1383const ageToBracket = function (age) {
1384 // Convert years to an age bracket
1385 if (!age) { return 'open' }
1386 for (const bracket of Array.from(ageBrackets)) {
1387 if (age <= bracket.max) {
1388 return bracket.slug
1389 }
1390 }
1391 return 'open'
1392}
1393
1394const bracketToAge = function (slug) {
1395 let higherBound, i, lowerBound

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected