js-mentorship-razvan / javascript

Javascript study notes
GNU General Public License v3.0
22 stars 2 forks source link

Bingo ( Or Not ) #609

Closed RazvanBugoi closed 2 years ago

RazvanBugoi commented 2 years ago

https://www.codewars.com/kata/5a1ee4dfffe75f0fcb000145/train/javascript

RazvanBugoi commented 2 years ago
function bingo(a) {
  const bingoRepresentation = [2, 7, 9, 14, 15];
  const isBingo = (currentValue) => a.includes(currentValue) ;

  return bingoRepresentation.every(isBingo) ? "WIN" : "LOSE"
}