FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

#1720 random-min-max 해답 번역 첫번째 줄 by kenna-hwa · Pull Request #1732 · javascript-tutorial/ko.javascript.info · GitHub

    • solution.md
    • task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
We need to "map" all values from the interval 0..1 into values from `min` to `max`.
우리는 0부터 1까지의 모든 값을 `min`부터 `max`까지의 범위로 '매핑' 해야합니다.

That can be done in two stages:

Expand All @@ -12,8 +12,7 @@ function random(min, max) {
return min + Math.random() * (max - min);
}

alert( random(1, 5) );
alert( random(1, 5) );
alert( random(1, 5) );
alert(random(1, 5));
alert(random(1, 5));
alert(random(1, 5));
```

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The built-in function `Math.random()` creates a random value from `0` to `1` (no

Write the function `random(min, max)` to generate a random floating-point number from `min` to `max` (not including `max`).

Examples of its work:
예시를 살펴봅시다.

```js
alert( random(1, 5) ); // 1.2345623452
Expand Down

Back | FazBrowse Home | New Git URL