js创建数组的三个方式
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <script> var arr01=[]; var arr02= new Array(5); //数组的长度 var arr03=new Array(1,233); arr01[0]="ab"; arr01[1]=12; arr01[2]=false; for(var i=0;i<arr01.length;i++){ console.log(arr01[i]); } </script> </head> <body> </body> </html>