GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing zh.javascript.info — 数组去重 回到课程 数组去重重要程度: 4
创建一个函数 例如:
让我们先遍历数字:
代码有效,但其中存在潜在的性能问题。 方法 所以如果 这本身并不是问题,因为 JavaScript 引擎速度非常快,所以遍历一个有 但是我们在 因此,如果 所以该解决方案仅适用于小型数组。 进一步,在后面的 Map and Set(映射和集合) 一章中,我们将看到如何对该方法进行优化。 |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |