개요
- Extract constact
- Replace Magic Number with Symbolic Constant
- 상수 추출
- 매직 넘버를 심볼릭 상수로 교체
- 매직 넘버를 상징적 상수로 교체
- 매직 넘버를 의미 있는 이름으로 교체
- 매직 넘버를 의미 있는 이름의 상수로 교체
for (let i = 1; i <= 52; i++) {
j = i + randomInt(53 - i) - 1;
a.swapEntries(i, j);
}
const deckSize = 52;
for (let i = 1; i <= deckSize; i++) {
j = i + randomInt(deckSize + 1 - i) - 1;
a.swapEntries(i, j);
}