Javascript basi...LOGIN

Javascript basic tutorial array

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;


##Second type:

var arr = new array(1,2);


The following code

<!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>


<script> document.write("欢迎学习数组"); </script>
submitReset Code
ChapterCourseware