Check Type of undefined - Javascript Data Type

Javascript examples for Data Type:undefined

Description

Check Type of undefined

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(){//w w w  . j  a  va 2 s  .com
var loc="/~a/v/c/homepage/";
var pathname = (loc).split('/');
console.log(typeof(pathname[7]));
if(pathname[7] === undefined) {
    console.log('Something...');
}
    }

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

Related Tutorials