배열 $.each() - index, value
페이지 정보

본문
<script>
var city = ["서울","대전","대구","부산"];
$.each(city, function(index, value){
document.write(index+" : "+value+"<br>");
});
// javascript 반복문
for(i=0; i<city.length; i++){
document.write(i+" : "+city[i]+"<br>");
}
</script>
[실행결과]
0 : 서울
1 : 대전
2 : 대구
3 : 부산
추천0 비추천0
- 이전글▼ jQuery 배열 관련 메서드 ( 냉무 ) 21.07.19
- 다음글배열 $.each() - key, value 21.07.19
댓글목록
등록된 댓글이 없습니다.