Closed PreethamRU closed 6 years ago
var hand1 = Hand.solve(['Ad', '2s', '9h', '4d', '5h']); hand1.name = 'preetham'; console.log('hand1 ==>'+hand1.name); // Two Pair console.log('hand1 ==> '+hand1.descr); var hand2 = Hand.solve(['Ad', 'As', 'Jc', '3h', '2d']); hand2.name='rocker'; console.log('hand2 ==> '+hand2.name); // Two Pair console.log('hand2 ==>'+hand2.descr); var hand3 = Hand.solve(['Ah', 'Ac', 'Jd', '3c', '2f']); hand3.name='Baxish'; console.log('hand2 ==> '+hand3.name); // Two Pair console.log('hand2 ==>'+hand3.descr); var winner = Hand.winners([hand1, hand3,hand2]); console.log(winner[0].name)
When I run that it gives me two winners and seems to be working correctly. Your console.log at the end is only logging the first winner.