Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Ben Bacarisse Newsgroups: comp.lang.javascript Subject: Re: Reverse elements in array, they can be integers or strings. Date: Sat, 16 May 2015 12:01:45 +0100 Organization: A noiseless patient Spider Lines: 22 Message-ID: <87382wokfa.fsf@bsb.me.uk> References: <2ddccd07-49e4-42c3-9ecc-27f047078f84@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="017616aa25f81ec581c44d76d61ba2f3"; logging-data="17660"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/vXV5xbqOrU8mXa0OIwcqGk73iZrnec6k=" Cancel-Lock: sha1:Hly6Af6mpN3l6ol4mjlZg1QoenI= sha1:hgykD6a5CrGin6nV+JxIgctEx1E= X-BSB-Auth: 1.e1f103add5473bea4c67.20150516120145BST.87382wokfa.fsf@bsb.me.uk Xref: csiph.com comp.lang.javascript:27671 jonas.thornvall@gmail.com writes: > 21 should encode to [1,10] in base eleven because 11+10. > But is stored in array as [01,1] > > Now i want a printout 1,10 You are still confusing numbers and their representations (or, maybe, you now understand but have not found a way to write about the distinction). Either way, it makes it impossible to communicate about numbers and their representations. There is a simple solution: console.log prints an unambiguous representation of a value. You could use that even if you don't fully understand the distinction it's making. For example, this method will distinguish between a string "[01,1]", an array of numbers [1,1], and an array of strings ["01","1"]. You seem to be asking how to turn [1,10] into "1,10" but that's too easy to be the question. -- Ben.