To find this out,
we'll take a look at a appending skills.length to the main div on the page.
Looking at the array, we have index zero, index one, index two, and index three.
So, let's go ahead and save this.
Come over to the browser and hit refresh.
And we can see that the skills length is four,
despite the fact that the last item in the array has an index of three.
So, looking at the question, is the length of an array equal to the last index?
The correct answer is no.
،لاكتشاف ذلك
.سنلقي نظرة على إلحاق skills.length إلى div الرئيسي في الصفحة
.وبالنظر إلى هذا الصفيف، سنجد أن لدينا الفهرس 0 والفهرس 1 والفهرس 2 والفهرس 3
.فلنمضِ قُدما ونقُم بحفظ ذلك
.ثم في المستعرض، نقوم بالنقر فوق تحديث
،وسيمكننا أن نجد أن طول المهارات هو 4
.بعض النظر عن أن العنصر الأخير في الصفيف به فهرس 3
"وبالرجوع إلى السؤال "هل طول الصفيف يساوي آخر فهرس؟
.الإجابة الصحيحة هي لا
main div에 skills.length를
append 해보겠습니다
배열에 0번째, 첫 번째, 두 번째
그리고 세 번째가 있습니다
저장하고
브라우저에서 새로 고침을 누르면
skills 배열의 마지막 항목 번지수가 3임에도
배열 길이는 4라는 것을 알 수 있습니다
문제를 다시 볼까요
배열 길이가 마지막 항목의 번지수와 같나요?
정답은 No입니다
Para descobrir,
vamos dar uma olhada em como anexar skills.length a main div na página.
No array, temos o índice zero, o índice um, o índice dois e o índice três.
Vamos em frente e salvar isso.
Vamos para o navegador e pressionamos Refresh.
E podemos ver que skills length é índice quatro,
apesar de o último item no array ter um índice três.
Então, de acordo com a questão, o comprimento de um array é igual ao último índice?
A resposta correta é não.
为了找出答案
我们先来看一下页面上 id 为 #main 的 div 元素里添加的 .length 方法
看这个数组 我们有索引号0 索引号1 索引号2 和 索引号3
记住这些 我们继续
点击刷新网页
我们可以看到 skills 数组的长度是4
尽管数组最后一位的索引号是3
所以 我们再来看这个问题 数组的长度等于数组最后一位的索引号吗?
正确答案是 No