TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Understanding JavaScript Arrays

34 点作者 heseltine将近 15 年前

4 条评论

svnv将近 15 年前
Isn't this faster for iterating over the elements:<p><pre><code> var a = ["banana", Math.min, 4, "apple"]; for (var i=a.length; i; i--) { console.log(a[i]); }</code></pre>
评论 #1554220 未加载
评论 #1544739 未加载
评论 #1544736 未加载
评论 #1545080 未加载
ccollins将近 15 年前
I want to stress that the following will work, but get you in trouble. Javascript does not support associative arrays.<p><pre><code> var myData = new Array; myData['key1'] = 'value1'; myData['key2'] = 'value2'; myData['key3'] = 'value3'; myData.length; //0</code></pre>
评论 #1544108 未加载
messel将近 15 年前
forEach,map, and several other ECMA5 methods look like a joy to use
msie将近 15 年前
This isn't your father's Array. Sigh.