Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JavaScript Pass an Array to Max and Min Methods Using Spread Operator</title> </head> <body> <script> let numbers = [1, 3, 2]; document.write(Math.max(...numbers) + "<br>"); // Prints: 3 document.write(Math.min(...numbers)); // Prints: 1 </script> <p><strong>Note:</strong> Spread operator is not supported in Internet Explorer.</p> </body> </html>