Computer Science, asked by dewas24, 5 months ago

Please give solution to this Javascript problem.
Will be marking brainlist
Give full code......​

Attachments:

Answers

Answered by jai696
3

\huge\red{\mid{\fbox{\tt{Using\: JavaScript}}\mid}}

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))

}

\large\mathsf\color{lightgreen}useful?\: \color{white}\longrightarrow\: \color{orange}brainliest!

Similar questions