An Unconventional Join

Submitted By:
david

Difficulty:
Easy

Tags:
rails, join, arrays, strings

Instructions:
Recently there was a bug in Rails' Logger that was caused by calling join without passing in any arguments. This is usually ok to do but sometimes it can give you some unexpected results. Try to solve the following problem without redefining join.

Hidden Code:
There is hidden code with assertions that is also being run to test out your code.

Code:
___

assert_equal "a_b_c", ["a", "b", "c"].join
assert_equal "123", [1, 2, 3].join('')

Your Solution

Ruby 1.9.3

Back to Problems