V
Size: a a a
V
t
V
t
let result;
for (let i = 0; i < invited.length - 1; i++) {
if(invited[i] <= invitedPeople && invited[i + 1] >= invitedPeople) {
result = i + 2;
break
}
}
return result ? result : 1
S
let result;
for (let i = 0; i < invited.length - 1; i++) {
if(invited[i] <= invitedPeople && invited[i + 1] >= invitedPeople) {
result = i + 2;
break
}
}
return result ? result : 1
NR
const thresholdsWithLevels = [
[1, 2],
[5, 3],
[10, 4],
[15, 5],
[20, 6],
]
const INITIAL_LEVEL = 0
const getReferralLevel = invitedPlayerCount => {
let result = INITIAL_LEVEL
for (let [threshold, level] of thresholdsWithLevels) {
if (invitedPlayerCount >= threshold) {
result = level
} else {
return result
}
}
}
S
const thresholdsWithLevels = [
[1, 2],
[5, 3],
[10, 4],
[15, 5],
[20, 6],
]
const INITIAL_LEVEL = 0
const getReferralLevel = invitedPlayerCount => {
let result = INITIAL_LEVEL
for (let [threshold, level] of thresholdsWithLevels) {
if (invitedPlayerCount >= threshold) {
result = level
} else {
return result
}
}
}
V
NR
const thresholdsWithLevels = [
[1, 2],
[5, 3],
[10, 4],
[15, 5],
[20, 6],
]
const INITIAL_LEVEL = 0
const getReferralLevel = invitedPlayerCount => {
let result = INITIAL_LEVEL
for (let [threshold, level] of thresholdsWithLevels) {
if (invitedPlayerCount >= threshold) {
result = level
} else {
break
}
}
return result
}
S
const thresholdsWithLevels = [
[1, 2],
[5, 3],
[10, 4],
[15, 5],
[20, 6],
]
const INITIAL_LEVEL = 0
const getReferralLevel = invitedPlayerCount => {
let result = INITIAL_LEVEL
for (let [threshold, level] of thresholdsWithLevels) {
if (invitedPlayerCount >= threshold) {
result = level
} else {
break
}
}
return result
}
V
V
N
N
З🧟
N
t
let result;
for (let i = 0; i < invited.length - 1; i++) {
if(invited[i] <= invitedPeople && invited[i + 1] >= invitedPeople) {
result = i + 2;
break
}
}
return result ? result : 1
N
З🧟
N