주어진 숫자의 절대값을 리턴한다!
https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Math/abs
Math.abs() - JavaScript | MDN
Math.abs() 함수는 주어진 숫자의 절대값을 반환합니다. x가 양수이거나 0이라면 x를 리턴하고, x가 음수라면 x의 반대값, 즉 양수를 반환합니다.
developer.mozilla.org
'Frontend > JavaScript' 카테고리의 다른 글
| padStart(); (2) | 2022.04.05 |
|---|---|
| String.prototype.repeat() (0) | 2022.04.05 |
| .localeCompare() | .sort() (0) | 2022.03.29 |
| Reduce 함수에 대해 알아보기! (0) | 2022.03.17 |
| Array. from() (0) | 2022.03.12 |