MathObject-1

 

Math is inbuilt object in javaScript and has lots of function for mathematical operations. In this example, We are using sqrt function of Math Object. Math sqrt function: Math.sqrt(16) this will result in 4. See the code snippet:

 
 
 
<!DOCTYPE html> <html> <head> <title>Welcome to LearnKode - A code learning platform</title> </head> <body> <p id="sample"></p> <script> var result = Math.sqrt(16); document.getElementById("sample").innerHTML = result; </script> </body> </html>
Output