HN
Hacker News
Top
New
Best
Ask
Show
Jobs
Comment by film42 | Hacker News Reader
Parent
Full thread
film42
·
"node".split("").sort.join("")
View on HN
hbn
·
This is the correct official answer except you didn't invoke sort
"node".split("").sort().join("")
film42
·
I write a lot of ruby, I guess...
msoad
·
wat
chrisco255
·
Sorting the letters by alphabetical order in "node" by converting each letter to its own string in an array. Slick JavaScript, basically.
msoad
·
yeah but you need to call sort as a function
justbaker
·
OP code would throw an exception. ^^
Reply on news.ycombinator.com