JavaScript Array (array)
The role of an array object is to use separate variable names to store a series of values.
How to create an array:
We have the following methods
The first one:
var arr = new array();
arr[0]=1;
arr[1]=2;
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>数组</title> </head> <body> <script type="text/javascript"> var arr =Array(); arr[0] = 1; arr[1] = 3; arr[2] = 5; </script> </body> </html>