Please give solution to this Javascript problem.
Will be marking brainlist
Give full code......
Attachments:
Answers
Answered by
3
const possibleBonus = (p1, p2) => {
if (p1 >= p2) {
return false
}
if ((p2 - p1) > 6) {
return false
}
return true
}
// test the function with provided inputs
for (let item of [[3, 7], [1, 9], [5, 3], [6, 6]]) {
console.log(item + ": " + possibleBonus(...item))
}
Similar questions