A handy way to do Array#join
Use [1, 2, 3] * ", "
instead of [1, 2, 3].join(", ")
.
Written by Shou Ya
Related protips
1 Response
Handy but I would prefer second approach since it's self-documenting one.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Related Tags
#ruby
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#