Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Ben Bacarisse Newsgroups: comp.lang.javascript Subject: Re: Bubblesort Date: Fri, 04 Mar 2016 19:26:30 +0000 Organization: A noiseless patient Spider Lines: 10 Message-ID: <8737s6doyh.fsf@bsb.me.uk> References: <0d68ee6d-8a80-439e-ae04-17743584e2e4@googlegroups.com> <086a7397-459b-46e3-b83c-cfc7edf4188a@googlegroups.com> <7b1ee9db-4732-48e1-be7e-37ba62db4c6e@googlegroups.com> <26b2b860-b6c6-40ff-bcf6-64d6a9baa55e@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="017616aa25f81ec581c44d76d61ba2f3"; logging-data="865"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19SMGslk/AU7dZhlUofB8zQdFfE41l+qpQ=" Cancel-Lock: sha1:tl0RUGRI2w/7RL0pjTMnbFen9jQ= sha1:1dZCuIMKefiBiCPxKCnzsn/JYfM= X-BSB-Auth: 1.2a91a2c3756f5128248c.20160304192630GMT.8737s6doyh.fsf@bsb.me.uk Xref: csiph.com comp.lang.javascript:29816 jonas.thornvall@gmail.com writes: > Sorry i bothered you your approach do indeed ***work***, apparently it > is a string but i can't understand how random makes a string value. Math.random() does not make a string but Array.prototype.sort() uses string comparison by default. It's documented. -- Ben.