Check function int parameter - Javascript Function

Javascript examples for Function:Function Argument

Description

Check function int parameter

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){/*from  ww  w  .j av  a2 s  .c  o  m*/
var sleepCheck = function (hours)
{
    if (hours >= 8)
    {
    console.log("You're getting plenty of sleep! Maybe too much!");
}
    else
    {
      console.log("Get some more shut eye!");
    }
};
sleepCheck(10);
sleepCheck(5);
sleepCheck(8);
    }

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

Related Tutorials