Infinity-4

 

In this example, we are going to generate the infinity value by multiplying number.maxvalue with 2. See the code snippet:

 
 
 
<!DOCTYPE html> <html> <head> <title>Welcome to LearnKode - A code learning platform</title> </head> <body> <p>Click the button to create a positive infinity.</p> <button onclick="positiveInfinity()">Click it</button> <p id="sample"></p> <script> function positiveInfinity() { var number = (Number.MAX_VALUE) * 2; document.getElementById("sample").innerHTML = number; } </script> </body> </html>
Output