Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JavaScript Find the Largest and Smallest Numbers in a Set</title> </head> <body> <script> document.write(Math.max(1, 3, 2) + "<br>"); // Prints: 3 document.write(Math.max(-1, -3, -2) + "<br>"); // Prints: -1 document.write(Math.min(1, 3, 2) + "<br>"); // Prints: 1 document.write(Math.min(-1, -3, -2)); // Prints: -3 </script> </body> </html>