1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> </head> <body> <div class=""> </div> </body> </html> <script type="text/javascript"> var arr=[1,2,3,4,"哈哈","呵呵",true, undefined,NaN]; console.log(arr,typeof arr); var divarray =document.getElementsByTagName("div"); console.log(divarray,typeof divarray); var stu={ name:"123", age:18 } console.log(stu,typeof stu); var arr=[1,2,3,4,"哈哈","呵呵",true, undefined,NaN,stu]; console.log(arr,typeof arr); for(var i = 0; i <= arr.length; i++){ document.write(arr[i]+'<br />'); } </script>
|