The group you are posting to is a
Usenet group . Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
From:
"Steve Onnis" <st... @cfcentral.com.au>
Date: Fri, 15 Jul 2011 10:54:46 +1000
Local: Thurs, Jul 14 2011 8:54 pm
Subject: Cleaning arrays
Why would this not work?
console.log(Array.from((",1,2,3,4").split(",")).clean())
The first item is returned as an empty string but i don't want it there at all...
Steve
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Paul Saukas <arasoihe... @gmail.com>
Date: Thu, 14 Jul 2011 21:02:52 -0400
Local: Thurs, Jul 14 2011 9:02 pm
Subject: Re: [Moo] Cleaning arrays
Because just '' has defind a blank string value. Clen will only remove a NULL or an Undefined value. you will want erase to get the effect you are looking for
console.log(Array.from((",1,2,3,4,").split(",")).erase(''))
On Thu, Jul 14, 2011 at 8:54 PM, Steve Onnis <st
... @cfcentral.com.au> wrote:
> Why would this not work?****
> ** **
> console.log(Array.from((",1,2,3,4").split(",")).clean())****
> ** **
> The first item is returned as an empty string but i don’t want it there at > all...****
> ** **
> Steve****
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Paul Saukas <arasoihe... @gmail.com>
Date: Thu, 14 Jul 2011 21:07:36 -0400
Local: Thurs, Jul 14 2011 9:07 pm
Subject: Re: [Moo] Cleaning arrays
Let me try that again as i forgot a key bit :) Array.from will create the blank string value to fill in for undefined
the console out put from your code ["", "1", "2", "3", "4"]. As to why it does that the mootools devs will know better then me. I just know it does it :D
On Thu, Jul 14, 2011 at 9:02 PM, Paul Saukas <arasoihe
... @gmail.com> wrote:
> Because just '' has defind a blank string value. Clen will only remove a
> NULL or an Undefined value. you will want erase to get the effect you are
> looking for
> console.log(Array.from((",1,2,3,4,").split(",")).erase(''))
> On Thu, Jul 14, 2011 at 8:54 PM, Steve Onnis <st... @cfcentral.com.au>wrote:
>> Why would this not work?****
>> ** **
>> console.log(Array.from((",1,2,3,4").split(",")).clean())****
>> ** **
>> The first item is returned as an empty string but i don’t want it there at >> all...****
>> ** **
>> Steve****
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Ryan Florence <rpflore... @gmail.com>
Date: Thu, 14 Jul 2011 22:10:42 -0600
Local: Fri, Jul 15 2011 12:10 am
Subject: Re: [Moo] Cleaning arrays
',1,2,3'.split(',') creates an empty string for the first element.
Array.clean only gets rid of null values and '' != null
You'll want to use Array.filter.
On Jul 14, 2011, at 6:54 PM, Steve Onnis wrote:
> Why would this not work?
> console.log(Array.from((",1,2,3,4").split(",")).clean())
> The first item is returned as an empty string but i don’t want it there at all...
> Steve
You must
Sign in before you can post messages.
You do not have the permission required to post.