<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Title</title>
<meta charset="UTF-8">
<script src="jquery-3.4.1.js"></script>
</head>
<body>
<script>
//1.jquery中的循环,example1
li=[11,22,33,44];
$.each(li,function(a,b){
console.log(a,b);
// });
// 结果:
// 0 11
// 1 22
// 2 33
// 3 44
//2.example2
dic={'firstname':'Lai','lastname':'star'}
$.each(dic,function (a,b) {
console.log(a,b);
})
//结果:
// firstname Lai
// lastname star
</script>

</body>
</html>

相关文章:

  • 2021-12-10
  • 2022-12-23
  • 2021-12-25
  • 2022-03-05
  • 2022-12-23
  • 2022-12-23
  • 2021-08-17
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-29
  • 2021-08-11
相关资源
相似解决方案