First Need to Create Nan function
1. Create a function :
<script type="text/javascript">
var x = 400;
var y = 10;
var z = "Lorem Ipsum is simply dummy text of the printing and typesetting industry.";
document.write(x/z);
</script>
<!-output Nan-->
<script type="text/javascript">
var x = 400;
var y = 10;
var z = "Lorem Ipsum is simply dummy text of the printing and typesetting industry.";
document.write(x/y);
</script>
<!-output 40-->
<!DOCTYPE html>
<html lang="en">
<head>
<title>PHP string replace function</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<div class="text-center">
<h1>What is NaN in Javascript?</h1>
</div>
<br>
<h4>Examples of NaN in javascript.</h4>
<div class="well">
<script type="text/javascript">
var x = 400;
var y = 10;
var z = "Lorem Ipsum is simply dummy text of the printing and typesetting industry.";
document.write(x/y);
</script>
</div>
<div class="well">
<script type="text/javascript">
var x = 400;
var y = 10;
var z = "Lorem Ipsum is simply dummy text of the printing and typesetting industry.";
document.write(x/z);
</script>
</div>
<br>
</div>
</body>
</html>