Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #27127
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.datemas.de!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail |
|---|---|
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
| Newsgroups | comp.lang.javascript |
| Subject | Re: Remove leading zeros in index of array |
| Date | Tue, 24 Mar 2015 20:47:47 +0100 |
| Organization | PointedEars Software (PES) |
| Lines | 29 |
| Message-ID | <2204699.Ha36KrdQoR@PointedEars.de> (permalink) |
| References | <2c9d128f-2237-4484-bbbe-2020864ec72a@googlegroups.com> <a2adb$55117781$6def49d7$1008@nntpswitch.blueworldhosting.com> <1518239.EFQcgAjVos@PointedEars.de> <75e22$5511bec1$6def49d7$5093@nntpswitch.blueworldhosting.com> |
| Reply-To | Thomas 'PointedEars' Lahn <cljs@PointedEars.de> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset="ISO-8859-1" |
| Content-Transfer-Encoding | 7Bit |
| X-Trace | solani.org 1427226567 26416 eJwNx8EBwCAIA8CVwJJIx6EB9x/B3u/w0KkdBAMH5xvr9bajso1/qU5NLsseyTe7NKg5k5HkBT1AEl4= (24 Mar 2015 19:49:27 GMT) |
| X-Complaints-To | abuse@news.solani.org |
| NNTP-Posting-Date | Tue, 24 Mar 2015 19:49:27 +0000 (UTC) |
| User-Agent | KNode/4.14.2 |
| X-User-ID | eJwNxsERACEIBLCWDmFZLAc56L8EnckjUBcvmsMNg2GiJLrzf2IOJyxaU3e/yLemdoxuI1hcjWCWeUlZYM66dKsV6w== |
| Cancel-Lock | sha1:RpYGXXGQhMKv+GDZp3sOPv5DW0E= |
| X-NNTP-Posting-Host | eJwNwocRwDAIBLCVQnnKOMH49x8hOQkWEic9EA7+cNmlT6Id3WU5qm/sTqdYkXOWLn5Ljcn6AAjLEM0= |
| Xref | csiph.com comp.lang.javascript:27127 |
Show key headers only | View raw
Cezary Tomczyk wrote:
> On 2015-03-24 20:21, Thomas 'PointedEars' Lahn wrote:
>> Cezary Tomczyk wrote:
>>> bin = bin.filter(function(element){
>>> if (element) {
>>> return element;
>>> }
>>> return false;
>>> });
>>
>> bin = bin.filter(function (e) { return e; });
>
> Your code is shorter then mine. However, I think it's just less readable
> in my opinion.
Wait till ES 6 (or use Node.js which already supports this):
bin = bin.filter(e => e);
;-)
<https://github.com/joyent/node/wiki/ES6-%28a.k.a.-Harmony%29-Features-Implemented-in-V8-and-Available-in-Node>
--
PointedEars
FAQ: <http://PointedEars.de/faq> | SVN: <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | ES Matrix: <http://PointedEars.de/es-matrix>
Please do not cc me. / Bitte keine Kopien per E-Mail.
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Remove leading zeros in index of array jonas.thornvall@gmail.com - 2015-03-23 04:57 -0700
Re: Remove leading zeros in index of array jonas.thornvall@gmail.com - 2015-03-23 10:03 -0700
Re: Remove leading zeros in index of array Scott Sauyet <scott.sauyet@gmail.com> - 2015-03-23 10:32 -0700
Re: Remove leading zeros in index of array Tim Streater <timstreater@greenbee.net> - 2015-03-23 18:36 +0000
Re: Remove leading zeros in index of array "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-03-23 20:42 +0100
Re: Remove leading zeros in index of array jonas.thornvall@gmail.com - 2015-03-23 12:58 -0700
Re: Remove leading zeros in index of array "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-03-23 21:12 +0100
Re: Remove leading zeros in index of array jonas.thornvall@gmail.com - 2015-03-23 13:16 -0700
Re: Remove leading zeros in index of array "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-03-23 21:36 +0100
Re: Remove leading zeros in index of array "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-03-23 21:49 +0100
Re: Remove leading zeros in index of array "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-03-23 21:58 +0100
Re: Remove leading zeros in index of array Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2015-03-24 15:41 +0100
Re: Remove leading zeros in index of array Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-03-24 20:21 +0100
Re: Remove leading zeros in index of array Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2015-03-24 20:45 +0100
Re: Remove leading zeros in index of array Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-03-24 20:47 +0100
Re: Remove leading zeros in index of array Scott Sauyet <scott.sauyet@gmail.com> - 2015-03-24 13:37 -0700
Re: Remove leading zeros in index of array Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2015-03-25 00:01 +0100
csiph-web