Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JavaScript Apply Built-in Methods</title> </head> <body> <script> var numbers = [2, 5, 6, 4, 3, 7]; // Using spread operator var max = Math.max(...numbers); document.write(max); // Prints: 7 document.write("<br>"); var min = Math.min(...numbers); document.write(min); // Prints: 2 </script> </body> </html>