valueOf() 메서드는 Number 객체의 랩핑된 기본(primitive) 타입을 반환합니다.

Syntax

numObj.valueOf()

Return value

지정한 Number 객체의 기본(primitive) 타입을 나타냅니다.

Description

이 메서드는 일반적으로 자바스크립트에 의해 내부적으로 호출되고, 웹 코드에서는 명시적으로 호출하지 않습니다.

Examples

Using valueOf

var numObj = new Number(10);
console.log(typeof numObj); // object

var num = numObj.valueOf();
console.log(num);           // 10
console.log(typeof num);    // number

Specifications

Specification Status Comment
ECMAScript 1st Edition (ECMA-262) Standard Initial definition. Implemented in JavaScript 1.1.
ECMAScript 5.1 (ECMA-262)
The definition of 'Number.prototype.valueOf' in that specification.
Standard  
ECMAScript 2015 (6th Edition, ECMA-262)
The definition of 'Number.prototype.valueOf' in that specification.
Standard  
ECMAScript Latest Draft (ECMA-262)
The definition of 'Number.prototype.valueOf' in that specification.
Draft  

Browser compatibility

Update compatibility data on GitHub
DesktopMobileServer
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.js
Basic supportChrome Full support YesEdge Full support YesFirefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yesnodejs Full support Yes

Legend

Full support  
Full support

See also

문서 태그 및 공헌자

이 페이지의 공헌자: DeadIntegral
최종 변경자: DeadIntegral,