`for (; amount--; )`2023. 6. 15.
react-scrollbars-custom의 예제를 보다가 충격적인 걸 봐갖고
export function renderAmountOfParagraphs(amount = 5, paragraphsProps) {
const result = [];
for (; amount--; ) { // ??
result.push(
<p {...paragraphsProps} className="ExampleCard-Paragraph" key={`paragraph_${amount}`}>
{getRandomParagraphText()}
</p>
);
}
return result;
}
export function renderAmountOfParagraphs(amount = 5, paragraphsProps) {
const result = [];
for (; amount--; ) { // ??
result.push(
<p {...paragraphsProps} className="ExampleCard-Paragraph" key={`paragraph_${amount}`}>
{getRandomParagraphText()}
</p>
);
}
return result;
}
?
for (; amount--; ) {
for (; amount--; ) {
?? 🤯
mdn의 for 관련 문서를 보니
🤯🤯
이 외에도 충격적인 게 더 있었는데:
🤯🤯🤯
Using for
with two iterating variables
🤯🤯🤯🤯