[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Global_Objects/Object/valueOf [Back]  [Original]

Object.prototype.valueOf() - JavaScript | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

Object.prototype.valueOf()

Baseline Widely available

This feature is well established and works across many devices and browser versions. Its been available across browsers since 2015 ..

valueOf() .

In this article

object.valueOf()

JavaScript valueOf . valueOf ; JavaScript , .

, valueOf , Object. , . , valueOf , :

js
[object Object]

valueOf . , Object.prototype.valueOf(), Object.

valueOf

, valueOf . .

, myNumberType valueOf. valueOf :

js
myNumberType.prototype.valueOf = function () {
  return customPrimitiveValue;
};

, , myNumberType , , JavaScript , .

valueOf JavaScript, , :

js
myNumber.valueOf();

: toString(), String, valueOf. "[object type]". , .

: valueOf

js
var o = new Object();
myVar = o.valueOf(); // [object Object]

Specification
ECMAScript 2027 LanguageSpecification
# sec-object.prototype.valueof


Web Proxy Viewer  |  New URL  |  Original Page