Javascript examples for Function:Function Argument
Check function int parameter
<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>