Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: "Jukka K. Korpela" Newsgroups: comp.lang.javascript Subject: Re: Objects comparaison ? Date: Fri, 14 Oct 2011 08:59:21 +0300 Organization: A noiseless patient Spider Lines: 24 Message-ID: References: <1k93ek2.1xghqcy1upjvv5N%unbewusst.sein@fai.invalid> <1783522.fYvYJRLvp5@PointedEars.de> <1k942ne.113p6qs1e2gd3fN%unbewusst.sein@fai.invalid> <1k94a7v.1vbmpjd11e944aN%unbewusst.sein@fai.invalid> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Fri, 14 Oct 2011 05:59:18 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="ngroV0xYIIv0dzjhyZhv5A"; logging-data="31118"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+24F7CkQ0OR7BAEUp1V1KV" User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:8.0) Gecko/20110929 Thunderbird/8.0 In-Reply-To: <1k94a7v.1vbmpjd11e944aN%unbewusst.sein@fai.invalid> X-Antivirus-Status: Clean X-Antivirus: avast! (VPS 111013-2, 14.10.2011), Outbound message Cancel-Lock: sha1:c1VvyMGtocsd+XmN14BDs7gYzfM= Xref: x330-a1.tempe.blueboxinc.net comp.lang.javascript:7377 14.10.2011 08:31, Une Bévue wrote: > Jukka K. Korpela wrote: > >>> I wanted to test my #include method on array : >> >> Which "#include method"? > > The one I've added to Array : > Array.prototype.include=function(s){ > for(var i=0,l=this.length;i return false; > } Tested with the code you posted earlier, var huit = { 'huit' : 8}; var ary = [ 0, 1, 3, 'trois', huit]; ary.include( huit ) returns true, as expected. So how did you test it when you got false? -- Yucca, http://www.cs.tut.fi/~jkorpela/