Javascript examples for Data Type:typeof
Use typeof to check the type of each array element
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){// w w w. j av a 2s. c o m var someArray = ['Mike','Brett','Kim','Steve','0.1','0',{name:'Oliver'}]; for(var i = 0; i < someArray.length; i++){ console.log(typeof someArray[i]) } } </script> </head> <body> </body> </html>