这次给大家带来JS字符串的遍历,截取,输出,计算操作,JS字符串遍历,截取,输出,计算操作的注意事项有哪些,下面就是实战案例,一起来看一下。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Character loop printing</title>
<script>
var people=['刘备','关羽','张飞','马超','赵云','黄忠','诸葛亮'];
for(var i=0;i<people.length;i++){
console.log(people[i])
}
</script>
</head>
<body>
</body>
</html>