저는 JavaScript 기술을 연구 중이며 그 작은 코드를 작성했습니다.
var Intel = ["a", "v", "f", "c", "s"];
if (Intel && Intel.constructor == Array) {
alert('correct');
} else {
alert("false");
}
alert(Intel.length);
function showThemAll() {
// this function will alert every single data of the table
for (var i = 0; i <= Intel.length; i++) {
//alert of the data
alert(Intel[i]);
}
}
showThemAll();
올바른 결과로 정의되지 않은 경고가 표시되는 이유를 이해할 수 없습니다.
저 좀 도와 주 시겠어요?
i <= Intel.length
배열은 0 인덱스이므로 =
다음으로 변경하면 정의되지 않은
for (var i = 0; i < Intel.length; i++) {
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다