Skip to content

Commit

Permalink
曖昧な表現を改善
Browse files Browse the repository at this point in the history
小数点以下を「丸める」⇒「切り捨てる」と明記
  • Loading branch information
manjuu-eater authored and mfuji09 committed Dec 12, 2024
1 parent 3deea1d commit 7117381
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ repeat(count)
"abc".repeat(0); // ''
"abc".repeat(1); // 'abc'
"abc".repeat(2); // 'abcabc'
"abc".repeat(3.5); // 'abcabcabc' (小数は丸められ、整数の結果が返されます
"abc".repeat(3.5); // 'abcabcabc' (小数点以下は切り捨てられます
"abc".repeat(1 / 0); // RangeError

({ toString: () => "abc", repeat: String.prototype.repeat }).repeat(2);
Expand Down

0 comments on commit 7117381

Please sign in to comment.