From cb9e359a51c3249d8f5157db69d43fd413ddeda6 Mon Sep 17 00:00:00 2001 From: Florian Merz Date: Thu, 11 Feb 2021 14:45:12 +0100 Subject: unslug ca: move --- .../global_objects/string/concat/index.html | 125 +++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 files/ca/web/javascript/reference/global_objects/string/concat/index.html (limited to 'files/ca/web/javascript/reference/global_objects/string/concat') diff --git a/files/ca/web/javascript/reference/global_objects/string/concat/index.html b/files/ca/web/javascript/reference/global_objects/string/concat/index.html new file mode 100644 index 0000000000..87cdda3c5e --- /dev/null +++ b/files/ca/web/javascript/reference/global_objects/string/concat/index.html @@ -0,0 +1,125 @@ +--- +title: String.prototype.concat() +slug: Web/JavaScript/Referencia/Objectes_globals/String/concat +translation_of: Web/JavaScript/Reference/Global_Objects/String/concat +--- +
{{JSRef}}
+ +

El mètode concat() combina el text de dos o més strings i retorna un nou string.

+ +

Sintaxi

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

Paràmetres

+ +
+
string2...stringN
+
Strings que seran concatenats a aquest string.
+
+ +

Descripció

+ +

La funció concat() combina el text d'un o més strings i retorna un nou string. Canvis al text d'un string no afecten l'altre string.

+ +

Exemples

+ +

Utilitzar concat()

+ +

L'exemple següent combina strings en un nou string.

+ +
var hola = 'Hola, ';
+console.log(hola.concat('Kevin', ' tingueu un bon dia.'));
+
+/* Hola, Kevin tingueu un bon dia. */
+
+ +

Rendiment

+ +

Es recomana altament utilitzar els {{jsxref("Operators/Assignment_Operators", "operadors d'assignació", "", 1)}} (+, +=) en comptes del mètode concat(). Vegeu aquest test de rendiment.

+ +

Especificacions

+ + + + + + + + + + + + + + + + + + + + + + + + +
EspecificacióEstatComentaris
{{SpecName('ES3')}}{{Spec2('ES3')}}Definició inicial. Implementat a 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')}} 
+ +

Compatibilitat amb navegadors

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + +
CaracterísticaChromeFirefox (Gecko)Internet ExplorerOperaSafari
Suport bàsic{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
CaracterísticaAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Suport bàsic{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +

Vegeu també

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