nan js

Solutions on MaxInterview for nan js by the best coders in the world

showing results for - "nan js"
Leonardo
26 Feb 2019
1let value = 0 / 0; // undefined
2if (isNaN(value)) value = 0;
Michela
26 May 2019
1// NaN:  Not a Number in javascript
2console.log(parseInt('1.23'));				// 1.23
3console.log(parseInt('something'));			// NaN
Zayne
23 May 2019
1NaN = Not a number.
Matías
21 Jan 2021
1var val = Number.NaN;
Ignacio
16 Oct 2020
1<html>
2   <head>      
3      <script type = "text/javascript">
4         <!--
5            function showValue() {
6               var dayOfMonth = 50;
7               
8               if (dayOfMonth < 1 || dayOfMonth > 31) {
9                  dayOfMonth = Number.NaN
10                  console.log("Day of Month must be between 1 and 31.")
11               }
12               Document.write("Value of dayOfMonth : " + dayOfMonth );
13            }
14         //-->
15      </script>      
16   </head>
17   
18   <body>
19      <p>Click the following to see the result:</p>      
20      <form>
21         <input type = "button" value = "Click Me" onclick = "showValue();" />
22      </form>      
23   </body>
24</html>