From 95aca4b4d8fa62815d4bd412fff1a364f842814a Mon Sep 17 00:00:00 2001 From: Ryan Johnson Date: Thu, 29 Apr 2021 16:16:42 -0700 Subject: remove retired locales (#699) --- .../global_objects/string/length/index.html | 90 ---------------------- 1 file changed, 90 deletions(-) delete mode 100644 files/it/web/javascript/reference/global_objects/string/length/index.html (limited to 'files/it/web/javascript/reference/global_objects/string/length') diff --git a/files/it/web/javascript/reference/global_objects/string/length/index.html b/files/it/web/javascript/reference/global_objects/string/length/index.html deleted file mode 100644 index e575b777b8..0000000000 --- a/files/it/web/javascript/reference/global_objects/string/length/index.html +++ /dev/null @@ -1,90 +0,0 @@ ---- -title: string.length -slug: Web/JavaScript/Reference/Global_Objects/String/length -translation_of: Web/JavaScript/Reference/Global_Objects/String/length ---- -
{{JSRef}}
- -

La proprietà length di un oggetto {{jsxref("String")}} indica la lunghezza di una stringa, in unità di codice UTF-16.

- -

Sintassi

- -
str.length
- -

Descrizione

- -

Questa proprietà restituisce il numero di unità di codice nella stringa. {{interwiki("wikipedia", "UTF-16")}}, il formato di stringa utilizzato da JavaScript, utilizza una singola unità di codice a 16 bit per rappresentare i caratteri più comuni, ma deve utilizzare due unità di codice per meno comunemente- caratteri usati, quindi è possibile che il valore restituito dalla length “lunghezza“ non corrisponda al numero effettivo di caratteri nella stringa.

- -

ECMASCript 2016 (ed. 7) ha stabilito una lunghezza massima di 2^53 - 1 elementi. In precedenza, non è stata specificata una lunghezza massima.. 

- -

Per una stringa vuota, length è 0.

- -

La proprietà statica String.length restituisce il valore 1.

- -

Esempi

- -

Basic usage

- -
var x = 'Mozilla';
-var empty = '';
-
-console.log('Mozilla is ' + x.length + ' code units long');
-/* "Mozilla è lungo 7 unità di codice" */
-
-console.log('La stringa vuota ha una lunghezza di
- ' + empty.length);
-/* "La stringa vuota ha una lunghezza di 0" */
- -

Assegnazione a length

- -
var myString = "bluebells";
-
-// Il tentativo di assegnare un valore alla proprietà .length di una stringa non ha alcun effetto osservabile.
-myString.length = 4;
-console.log(myString);
-/* "bluebells" */
-
- -

Specificazioni

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SpecificazioniStatoCommenti
{{SpecName('ES1')}}{{Spec2('ES1')}}Definizione iniziale Implementato in JavaScript 1.0.
{{SpecName('ES5.1', '#sec-15.5.5.1', 'String.prototype.length')}}{{Spec2('ES5.1')}} 
{{SpecName('ES6', '#sec-properties-of-string-instances-length', 'String.prototype.length')}}{{Spec2('ES6')}} 
{{SpecName('ESDraft', '#sec-properties-of-string-instances-length', 'String.prototype.length')}}{{Spec2('ESDraft')}} 
- -

Browser compatibili

- - - -

{{Compat("javascript.builtins.String.length")}}

- -

Guarda anche

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