Testing various values using isFinite() and isInteger()

Testing various values using isFinite() and isInteger()

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Test Page</title>
</head>


<body>


  <script type="text/javascript">

    var a = "True";
    var b = 10.12;
    var c = 15;
    var d = "15";

    var x = Number.isFinite(a);
    var y = Number.isFinite(b);
    var z = Number.isFinite(c);
    var q = Number.isFinite(d);


    var xx = Number.isInteger(a);
    var yy = Number.isInteger(b);
    var zz = Number.isInteger(c);
    var qq = Number.isInteger(d);

    console.log(x);
    console.log(y);
    console.log(z);
    console.log(q);
    console.log(xx);
    console.log(yy);
    console.log(zz);
    console.log(qq);

  </script>
</body>
</html>



Comments

Popular posts from this blog