From 4b1a9203c547c019fc5398082ae19a3f3d4c3efe Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:41:15 -0500 Subject: initial commit --- .../global_objects/string/concat/index.html | 140 +++++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 files/de/web/javascript/reference/global_objects/string/concat/index.html (limited to 'files/de/web/javascript/reference/global_objects/string/concat/index.html') diff --git a/files/de/web/javascript/reference/global_objects/string/concat/index.html b/files/de/web/javascript/reference/global_objects/string/concat/index.html new file mode 100644 index 0000000000..548135330f --- /dev/null +++ b/files/de/web/javascript/reference/global_objects/string/concat/index.html @@ -0,0 +1,140 @@ +--- +title: String.prototype.concat() +slug: Web/JavaScript/Reference/Global_Objects/String/concat +tags: + - JavaScript + - Method + - Prototype + - Reference + - String +translation_of: Web/JavaScript/Reference/Global_Objects/String/concat +--- +
{{JSRef}}
+ +

Die concat() Methode vereint den Text von einem oder mehreren Strings und gibt einen neuen String zurück.

+ +

Syntax

+ +
str.concat(string2[, string3, ..., stringN])
+ +

Parameters

+ +
+
string2...stringN
+
Strings die zu einem neuen String vereint werden sollen.
+
+ +

Rückgabewert

+ +

Ein neuer String, der die Texte der Strings hintereinander enthält.

+ +

Beschreibung

+ +

Die concat() Funktion kombiniert die Texte von einem oder mehreren Strings und gibt einen neuen String zurück. Das ändern des Textes eines Strings hat keine Auswirkungen auf die anderen Strings.

+ +

Beispiele

+ +

Einsatz von concat()

+ +

Das folgende Beispiel kombiniert Strings in einen neuen String.

+ +
var hello = 'Hello, ';
+console.log(hello.concat('Kevin', ' have a nice day.'));
+
+/* Hello, Kevin have a nice day. */
+
+ +

Performance

+ +

Es wird ausdrücklich empfohlen {{jsxref("Operators/Assignment_Operators", "Zuweisungsoperatoren", "", 1)}} (+, +=) statt der concat() Methode zu benutzen. Sie hierfür diesen Performancetest.

+ +

Spezifikationen

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SpezifikationStatusKommentar
{{SpecName('ES3')}}{{Spec2('ES3')}}Initiale Definition. Implementiert in JavaScript 1.2.
{{SpecName('ES5.1', '#sec-15.5.4.6', 'String.prototype.concat')}}{{Spec2('ES5.1')}} 
{{SpecName('ES6', '#sec-string.prototype.concat', 'String.prototype.concat')}}{{Spec2('ES6')}} 
{{SpecName('ESDraft', '#sec-string.prototype.concat', 'String.prototype.concat')}}{{Spec2('ESDraft')}} 
+ +

Browserkompatibilität

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +

Siehe auch

+ + -- cgit v1.2.3-54-g00ecf