aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/javascript/reference/global_objects/number/tosource/index.md
blob: 0d6c3c04fb7ec27bcfe5820f4c167e068162af42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
title: Number.prototype.toSource()
slug: Web/JavaScript/Reference/Global_Objects/Number/toSource
tags:
  - JavaScript
  - メソッド
  - Number
  - 非推奨
  - プロトタイプ
browser-compat: javascript.builtins.Number.toSource
translation_of: Web/JavaScript/Reference/Global_Objects/Number/toSource
---
{{JSRef}} {{deprecated_header}}

**`toSource()`** メソッドは、オブジェクトのソースコードを表す文字列を返します。

## 構文

```js
toSource()
```

### 返値

そのオブジェクトのソースコードを表す文字列です。

## 例

### ネイティブ関数

組み込みの {{jsxref("Number")}} オブジェクトでは、`toSource()` はソースコードが利用できないことを表す次の文字列を返します。

```js
function Number() {
    [native code]
}
```

{{jsxref("Number")}} のインスタンスでは、 `toSource()` はソースコードを表す文字列を返します。

このメソッドは JavaScript で内部的に呼び出されるものであり、ウェブのコードから明示的に呼び出されるものではありません。

## 仕様書

標準には含まれていません。

## ブラウザーの互換性

{{Compat}}

## 関連情報

- {{jsxref("Object.prototype.toSource()")}}