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: Why JavaScript 'seems' to get addition wrong Date: Fri, 02 Oct 2015 16:16:14 +0100 Organization: A noiseless patient Spider Lines: 18 Message-ID: <87y4flqp1d.fsf@bsb.me.uk> References: <1588ee9e-9182-41fc-bc23-7b7a33739268@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="017616aa25f81ec581c44d76d61ba2f3"; logging-data="29906"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18vsv+FkQ9tN5JO2P3cNmJMEjOUL9nCuyY=" Cancel-Lock: sha1:gWLFUUkVeg52w8mHhxsGXvyburY= sha1:JXSt3M0V15Aat/Lim4u8s/9m8mM= X-BSB-Auth: 1.7d08179a131e3dbe4921.20151002161614BST.87y4flqp1d.fsf@bsb.me.uk Xref: csiph.com comp.lang.javascript:28791 AbdulFattah Popoola writes: > One of the most popular gotchas of JavaScript is its behaviour when > adding operands. For example, the output of {} + 2 is different from 2 > + {}. That's not an example of addition. I think it's better to say that one of the gochas of EcmaScript is that + means more than one thing. > I explained why the puzzling results occur in this post: > http://abdulapopoola.com/2015/09/30/why-javascript-seems-to-get-addition-wrong/. > > Please do share your feedback. Share you explanation here, and I'll share my feedback here. -- Ben.