To get the square root of 2, use the JavaScript Math SQRT2 property. It returns the square root of 2 which is approximately 1.414.
Example
You can try to run the following code to get the square root of 2 in JavaScript −
<html>
<head>
<title>JavaScript Math SQRT2 Property</title>
</head>
<body>
<script>
var property_value = Math.SQRT2
document.write("Property Value: " + property_value);
</script>
</body>
</html>