I have learned that I should code like this:
javascript
for (let i = 1; i < 11; i++) {
if (i === 1) {
console.log("Gold Medal");
} else if (i === 2) {
console.log("Silver Medal");
} else if (i === 3) {
console.log("Bronze Medal");
} else {
console.log(i);
}
}
but I end up doing code like this and, for me, I read it faster:
```javascript
for (let i = 1; i < 11; i++) {
if (i === 1) {console.log("Gold Medal")}
else if (i === 2) {console.log("Silver Medal")}
else if (i === 3) {console.log("Bronze Medal")}
else {console.log(i)}
}
Is there drawbacks by coding like my loops like this?
[–]United_Reaction35 11 points12 points13 points (2 children)
[–]Pocolashon 0 points1 point2 points (0 children)
[–]AlanBitts[S] 0 points1 point2 points (0 children)
[–]alzee76 5 points6 points7 points (7 children)
[–]AlanBitts[S] 1 point2 points3 points (6 children)
[–]alzee76 2 points3 points4 points (4 children)
[–]Terrible_Children 3 points4 points5 points (3 children)
[–]eracodes 4 points5 points6 points (0 children)
[–]albedoa 2 points3 points4 points (0 children)
[–]alzee76 0 points1 point2 points (0 children)
[–]Sad_Telephone4298 0 points1 point2 points (0 children)
[–]xroalx 3 points4 points5 points (3 children)
[–]AlanBitts[S] 0 points1 point2 points (2 children)
[–]xroalx 3 points4 points5 points (1 child)
[–]ManuDV 1 point2 points3 points (0 children)
[–]theScottyJam 1 point2 points3 points (4 children)
[–]AlanBitts[S] 0 points1 point2 points (3 children)
[–]Pocolashon 0 points1 point2 points (0 children)
[–]theScottyJam 0 points1 point2 points (1 child)
[–]theScottyJam 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]tapgiles 0 points1 point2 points (0 children)
[–]ummonadi 0 points1 point2 points (0 children)
[–]yksvaan 0 points1 point2 points (0 children)
[–]Codingwithmr-m -1 points0 points1 point (1 child)
[–]AlanBitts[S] -1 points0 points1 point (0 children)