Math.SQRT2

Math.SQRT2 는 2의 제곱근을 나타내고 약 1.414 입니다:

Math.SQRT2 = 2 1.414 \mathtt{\mi{Math.SQRT2}} = \sqrt{2} \approx 1.414

Property attributes of Math.SQRT2
Writable 불가능
Enumerable 불가능
Configurable 불가능

설명

SQRT2Math의 정적 메서드 이므로 만든 Math 객체의 메서드가 아니라 항상 Math.SQRT2 함수를 사용해야합니다. (Math는 생성자가 없습니다.)

예제

Math.SQRT2

이 함수는 2의 제곱근을 반환합니다.

js
function getRoot2() {
  return Math.SQRT2;
}

getRoot2(); // 1.4142135623730951

명세서

Specification
ECMAScript Language Specification
# sec-math.sqrt2

브라우저 호환성

BCD tables only load in the browser

참조