Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[자동차 경주 게임] 김용래 미션 제출합니다. #116

Closed
wants to merge 17 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: 템플릿 문자열 적용
  • Loading branch information
usageness committed Dec 7, 2021
commit f1557a85aef85ec1d40fd440476c603823dbcd0f
8 changes: 4 additions & 4 deletions src/car/CarList.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ class CarList {
const racingWinners = document.getElementById("racing-winners");
let resultText = "";
for(let i = 0; i<this.array.length; i++) {
resultText += "\n" + this.array[i].getName() + ": " + this.array[i].displayDistance();
resultText += `\n${this.array[i].getName()}: ${this.array[i].displayDistance()}`;
}

racingWinners.innerText += resultText + "\n";
racingWinners.innerText += `${resultText}\n`;
}

displayWinner() {
Expand All @@ -68,7 +68,7 @@ class CarList {
resultString = winnerArray.toString();
}

racingWinners.innerText += "\n최종 우승자: " + resultString;
racingWinners.innerText += `\n최종 우승자: ${resultString}`;
}

getWinnerArray() {
Expand Down Expand Up @@ -96,7 +96,7 @@ class CarList {
winnerResult += winnerArray[i];
}
else {
winnerResult += ", " + winnerArray[i];
winnerResult += `, ${winnerArray[i]}`;
}
}

Expand Down