Javascript examples for Data Type:undefined
Check Type of undefined
<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>