Timeline for Type uniqchars!
Current License: CC BY-SA 3.0
13 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Oct 6, 2015 at 1:15 | comment | added | azz | @edc65 Not sure why I originally went for array comprehension over the spread operator, when I use the latter far more than the former. Good catch. | |
| Oct 6, 2015 at 1:14 | history | edited | azz | CC BY-SA 3.0 | Switch to spread operator |
| Oct 5, 2015 at 14:40 | comment | added | edc65 | Answering myself: yes 2ality.com/2015/01/es6-maps-sets.html. And this can be made even shorter: s=>[...new Set(s)].join" or (tested in Firefox) s=>[...Set(s)].join" (21 bytes) | |
| Oct 5, 2015 at 14:32 | comment | added | edc65 | But are we sure that the conversion to Set mantains the original order? | |
| Oct 5, 2015 at 14:32 | comment | added | edc65 | @PatrickRoberts it's the conversion to a set. A set by definition has no dupluicates | |
| Oct 5, 2015 at 14:17 | comment | added | Patrick Roberts | Please excuse my ignorance but at what point does this filter unique values? It looks like it just converts a string to a set to an array then joins the values resulting in the original string again. | |
| Oct 5, 2015 at 10:46 | history | edited | azz | CC BY-SA 3.0 | Not sure how that space slipped by un-removed...; edited body |
| Oct 5, 2015 at 10:43 | comment | added | azz | Transpiled code without new resulted in Uncaught TypeError: Constructor Set requires 'new' in Google Chrome. | |
| Oct 5, 2015 at 10:39 | history | edited | azz | CC BY-SA 3.0 | Remove space after Set() and made function anonymous. |
| Oct 5, 2015 at 10:37 | comment | added | azz | Wasn't sure of the rules with anon functions, and good catch on the space. | |
| Oct 5, 2015 at 10:36 | comment | added | manatwork | The spaces around for's expression are not necessary and you could make it anonymous function as some other solutions did: s=>[for(c of Set(s))c].join``. (Pale update: not 100% sure, but the new keyword seems also unnecessary.) | |
| Oct 5, 2015 at 10:32 | review | First posts | |||
| Oct 5, 2015 at 13:28 | |||||
| Oct 5, 2015 at 10:31 | history | answered | azz | CC BY-SA 3.0 |