pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/String/valueOf

dule">

このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。

View in English Always switch to English

String.prototype.valueOf()

Baseline 広く利用可能

この機能は広く実装されており、多くのバージョンの端末やブラウザーで動作します。2015年7月以降、すべてのブラウザーで利用可能です。

valueOf()String 値のメソッドで、この文字列値を返します。

試してみましょう

const stringObj = new String("foo");

console.log(stringObj);
// 予想される結果: String { "foo" }

console.log(stringObj.valueOf());
// 予想される結果: "foo"

構文

js
valueOf()

引数

なし。

返値

与えられた String オブジェクトのプリミティブ値を表す文字列です。

詳細

String オブジェクトの valueOf() メソッドは、String オブジェクトの文字列型としてのプリミティブ値を返します。この値は、String.prototype.toString() の返値と等価です。

このメソッドは通常、JavaScript によって内部的に呼ばれ、コード中で明示的に呼ばれることはありません。

valueOf() メソッドの使用

js
const x = new String("Hello world");
console.log(x.valueOf()); // 'Hello world'

仕様書

仕様書
ECMAScript® 2027 Language Specification
# sec-string.prototype.valueof

ブラウザーの互換性

関連情報

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy