Correcting teacher:PHPz
Correction status:qualified
Teacher's comments:
PHP中的遍历语法模板
<?php $cars = ['宝马3GT xDrive 330li 耀石灰', '宝马X5 xDrive30i x', '宝马750li xdrive v8 M'];?>
<? foreach ( $cars as $a ):?>
<li style = 'color:red'>
<a href = ''><? echo $a?></a>
</li>
<?endforeach?>
js 中的遍历 数组方法
<script type = 'text/javascript'>
let cars = ['宝马3GT xDrive 330li 耀石灰', '宝马X5 xDrive30i x', '宝马750li xdrive v8 M'];
// for ( let i = 0; i < cars.length; i++ ) {
// alert( cars[i] );
// }
let li = document.createElement("li");
let a = cars.forEach((a,b) => alert(a));
</script>