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) --- .../reference/global_objects/math/max/index.html | 145 --------------------- 1 file changed, 145 deletions(-) delete mode 100644 files/it/web/javascript/reference/global_objects/math/max/index.html (limited to 'files/it/web/javascript/reference/global_objects/math/max') diff --git a/files/it/web/javascript/reference/global_objects/math/max/index.html b/files/it/web/javascript/reference/global_objects/math/max/index.html deleted file mode 100644 index 1c7f425fd0..0000000000 --- a/files/it/web/javascript/reference/global_objects/math/max/index.html +++ /dev/null @@ -1,145 +0,0 @@ ---- -title: Math.max() -slug: Web/JavaScript/Reference/Global_Objects/Math/max -tags: - - JavaScript - - Math - - Referenza - - metodo -translation_of: Web/JavaScript/Reference/Global_Objects/Math/max ---- -
{{JSRef}}
- -

La funzione Math.max() restituisce il massimo tra zero o più numeri.

- -

Sintassi

- -
Math.max([valore1[, valore2[, ...]]])
- -

Parametri

- -
-
valore1, valore2, ...
-
Numeri.
-
- -

Descrizione

- -

Dato che max() è un metodo statico di Math, viene solitamente usato tramite Math.max(), piuttosto che come metodo di un oggetto di tipo Math (Math non è un construttore).

- -

Se non vengono passati parametri, il risultato è -{{jsxref("Infinity")}}.

- -

Se anche solo uno dei parametri non può essere convertito a numero, il risultato è {{jsxref("NaN")}}.

- -

Esempi

- -

Usando Math.max()

- -
Math.max(10, 20);   //  20
-Math.max(-10, -20); // -10
-Math.max(-10, 20);  //  20
-
- -

La seguente funzione usa il metodo {{jsxref("Function.prototype.apply()")}} per trovare l'elemento massimo in un array di numeri. 
- getMaxOfArray([1, 2, 3]) è equivalente a Math.max(1, 2, 3) ma può essere usata con array di qualunque dimensione creati programmaticamente.

- -
function getMaxOfArray(numArray) {
-  return Math.max.apply(null, numArray);
-}
-
- -

Con il nuovo {{jsxref("Operators/Spread_operator", "spread operator")}}, ottenere l'elemento massimo di un array è ancora più semplice.

- -
var arr = [1, 2, 3];
-var max = Math.max(...arr);
-
- -

Specifiche

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SpecificheStatoCommento
{{SpecName('ES1')}}{{Spec2('ES1')}}Definizione iniziale. Implementata in JavaScript 1.0.
{{SpecName('ES5.1', '#sec-15.8.2.11', 'Math.max')}}{{Spec2('ES5.1')}} 
{{SpecName('ES6', '#sec-math.max', 'Math.max')}}{{Spec2('ES6')}} 
{{SpecName('ESDraft', '#sec-math.max', 'Math.max')}}{{Spec2('ESDraft')}} 
- -

Compatibilità browser

- -
{{CompatibilityTable}}
- -
- - - - - - - - - - - - - - - - - - - -
FunzionalitàChromeFirefox (Gecko)Internet ExplorerOperaSafari
Supporto base{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
FunzionalitàAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Supporto base{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
- -

Vedi inoltre

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