Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015년 7월.
Math.abs() 정적 메서드는 숫자의 절대 값을 반환합니다.
숫자.
x의 절대 값. x가 음수라면(-0 포함) -x를 반환합니다. 그렇지 않으면 x를 반환합니다. 따라서 결과는 언제나 양수 혹은 0입니다.
abs()는 Math의 정적 메서드이기 때문에, 생성한 Math 객체(Math는 생성자가 아닙니다)의 메서드 대신 언제나 Math.abs()를 사용해야 합니다.
Math.abs() 매개변수를 숫자로 강제 변환시킵니다. 변환할 수 없는 값은 NaN이 되며, Math.abs()도 NaN을 반환합니다.
| ECMAScript® 2027 Language Specification # sec-math.abs |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2025년 2월 11일 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.