Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: Dr J R Stockton Newsgroups: comp.lang.javascript Subject: Re: Comparing arraies Date: Sun, 5 Feb 2012 16:47:36 +0000 Organization: Home Lines: 28 Message-ID: References: <8dc6b834-cd20-47a5-a085-f4d5e4402c38@c13g2000yqk.googlegroups.com> <1634287.nPeGqDzKj4@PointedEars.de> <1946200.aqSPkdTlGX@PointedEars.de> <1660771.jP65nafYdu@PointedEars.de> <7a3a197b-9f8c-45a1-92aa-22a3a5d0b297@t15g2000yqi.googlegroups.com> <3325601.CWPS83hRNz@PointedEars.de> <336bb7d2-5ab8-46ea-88a3-2e5e47cb9663@o20g2000yqh.googlegroups.com> <1949843.mKqTvaHIzj@PointedEars.de> <6fbfd423-02ec-49a8-a3a2-345e9271e74c@k28g2000yqn.googlegroups.com> NNTP-Posting-Host: JfH6RRPWQh8XzArFI0xgxA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain;charset=us-ascii X-Complaints-To: abuse@aioe.org User-Agent: Turnpike/6.05-S () X-Notice: Filtered by postfilter v. 0.8.2 Xref: x330-a1.tempe.blueboxinc.net comp.lang.javascript:11199 In comp.lang.javascript message , Sat, 4 Feb 2012 10:34:56, John G Harris posted: >The example you are looking for is the function that returns the current >time. It returns different values at different times, so lacks any >Referential transparency. I know of a constructor which does that; but is it a function? Of course, it can be put into an undoubted function. If one's code is quick enough, it can return the same result repeatedly at slightly different times. Math.random() will almost always return a different result for every call, until after 2^n calls, where n is not necessarily as large as should be hoped for. function AllDiff() { return +new Date() + String(Math.random()) } should never repeat itself, unless Math.random is either unexpectedly good or bad, or the computer is prodigiously fast. -- (c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME. Web - FAQish topics, acronyms, & links. Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036) Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)