Table of contents
Step 4: Traverse each element through the for loop feature
Step 1: Our Framework
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<script>
</script>
</body>
</html>
Step 2: We define an array
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<script>
var sex = [1, 2, 3, 4, 5, 6, 7, 8];
</script>
</body>
</html>
Step 3: Traversal Preparation
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<script>
var sex = [1, 2, 3, 4, 5, 6, 7, 8];
console.log(sex);
</script>
</body>
</html>
Step 4: Traverse each element through the for loop feature
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<script>
var sex = [1, 2, 3, 4, 5, 6, 7, 8];
for (var i = 0; i < sex.length; i++) {
console.log(sex[i]);
}
</script>
</body>
</html>