The first item is returned as an empty string but i don’t want it there at all...
Steve
Paul Saukas
unread,
Jul 14, 2011, 9:02:52 PM7/14/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mootool...@googlegroups.com
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
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mootool...@googlegroups.com
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
Ryan Florence
unread,
Jul 15, 2011, 12:10:42 AM7/15/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mootool...@googlegroups.com
',1,2,3'.split(',') creates an empty string for the first element.
Array.clean only gets rid of null values and '' != null