Skip to content

Commit

Permalink
refactor: getNumOfMatch함수에서 let 대신 const 사용
Browse files Browse the repository at this point in the history
Co-authored-by: Jbee <ljyhanll@gmail.com>
  • Loading branch information
365kim and JaeYeopHan committed Apr 17, 2021
1 parent c3b7b20 commit 099d567
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/WinningResult.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ export default class WinningResult extends Component {

getNumOfMatch(lotto) {
const { winningNumbers, bonusNumber } = this.props.drawNumber;
let numOfMatch = lotto.reduce((acc, cur) => acc + Number(winningNumbers.includes(cur)), 0);
const numOfMatch = lotto.reduce((acc, cur) => acc + Number(winningNumbers.includes(cur)), 0);

if (numOfMatch === BONUS_CHECK_REQUIRED_COUNT && lotto.includes(bonusNumber)) {
numOfMatch += BONUS_COUNT;
return numOfMatch + BONUS_COUNT;
}
return numOfMatch;
}
Expand Down

0 comments on commit 099d567

Please sign in to comment.