<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>welefen的随笔</title>
	<atom:link href="http://www.welefen.com/tag/array/feed" rel="self" type="application/rss+xml" />
	<link>http://www.welefen.com</link>
	<description>前端打杂者@baidu</description>
	<lastBuildDate>Tue, 07 Feb 2012 07:28:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>javascript数组唯一化实现方式</title>
		<link>http://www.welefen.com/javascript-array-unique.html</link>
		<comments>http://www.welefen.com/javascript-array-unique.html#comments</comments>
		<pubDate>Mon, 07 Dec 2009 05:10:18 +0000</pubDate>
		<dc:creator>welefen</dc:creator>
				<category><![CDATA[前端开发]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[unique]]></category>
		<category><![CDATA[唯一化]]></category>
		<category><![CDATA[数组]]></category>

		<guid isPermaLink="false">http://www.welefen.com/?p=104</guid>
		<description><![CDATA[到目前为止，javascript中array还没有内置的unique方法，本来这篇文章很早就写了，但由于之前的虚拟主机忘记续费导致数据丢了，前几天JerryQu问了我这个问题，觉得可能还有其他人要，这里在写出来，备大家参考。 实现方式 这里给出2中实现方式。一种是大家应该都知道的indexOf检测的方式，另一种是结合lastIndexOf和splice实现方式。 //首先给Array对象原型上添加indexOf和lastIndexOf方法.(如果没有的话) if(!Array.prototype.indexOf){ Array.prototype.indexOf = function(element, index){ var length = this.length; if(index == null){ index = 0; }else{ index = +index &#124;&#124; 0; if(index < 0) index+= length; if(index < 0) index = 0; } for(var current;index= length) index = length &#8211; 1; } for(var current;index>=0;index&#8211;){ current = this[index]; if(current === element) return [...]]]></description>
		<wfw:commentRss>http://www.welefen.com/javascript-array-unique.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using eaccelerator
Database Caching 1/9 queries in 0.006 seconds using disk: basic
Object Caching 322/336 objects using disk: basic

Served from: welefen.com @ 2012-02-08 03:30:29 -->
