blob: b9c5fa30f3cb40612fe5caa7100d32fe326cf649 (
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
---
title: Number.parseInt()
slug: Web/JavaScript/Reference/Global_Objects/Number/parseInt
tags:
- ECMAScript 2015
- JavaScript
- Method
- Number
translation_of: Web/JavaScript/Reference/Global_Objects/Number/parseInt
---
<div>{{JSRef}}</div>
<p>Die <strong><code>Number.parseInt()</code></strong> Methode liest ein String-Argument ein und gibt eine ganze Zahl im angegebenen Zahlensystem zurück.</p>
<div>{{EmbedInteractiveExample("pages/js/number-parseint.html")}}</div>
<h2 id="Syntax">Syntax</h2>
<pre class="syntaxbox">Number.parseInt(<var>string</var>[, <var>radix</var>])</pre>
<h3 id="Parameter">Parameter</h3>
<div>{{page("de/docs/Web/JavaScript/Reference/Global_Objects/parseInt", "Parameter")}}</div>
<h3 id="Rückgabewert">Rückgabewert</h3>
<p>{{page("de/docs/Web/JavaScript/Reference/Global_Objects/parseInt", "Rückgabewert")}}</p>
<h2 id="Beschreibung">Beschreibung</h2>
<p>Diese Methode hat den gleichen Funktionsumfang wie die globalen {{jsxref("parseInt", "parseInt()")}} Funktion:</p>
<pre class="brush: js">Number.parseInt === parseInt; // true</pre>
<p>Sie ist Teil von ECMAScript 2015 und hat als Ziel die Modularisierung von globalen Funktionen. Mehr Details und Beispiele im Artikel {{jsxref("parseInt", "parseInt()")}}.</p>
<h2 id="Polyfill">Polyfill</h2>
<pre class="brush: js">if (Number.parseInt === undefined)
Number.parseInt = window.parseInt;</pre>
<h2 id="Spezifikationen">Spezifikationen</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">Spezifikation</th>
<th scope="col">Status</th>
<th scope="col">Komment</th>
</tr>
<tr>
<td>{{SpecName('ES6', '#sec-number.parseint', 'Number.parseInt')}}</td>
<td>{{Spec2('ES6')}}</td>
<td>Initiale Definition.</td>
</tr>
<tr>
<td>{{SpecName('ESDraft', '#sec-number.parseint', 'Number.parseInt')}}</td>
<td>{{Spec2('ESDraft')}}</td>
<td> </td>
</tr>
</tbody>
</table>
<h2 id="Browserkompatibilität">Browserkompatibilität</h2>
<p>{{Compat("javascript.builtins.Number.parseInt")}}</p>
<h2 id="Siehe_auch">Siehe auch</h2>
<ul>
<li>{{jsxref("Number")}}</li>
<li>{{jsxref("parseInt", "parseInt()")}}</li>
</ul>
|