array join() method without a separator

Viewed 26143
var arr= ['g','o','o','d'];
var arr2 = arr.join();

Arr2 will be "g,o,o,d". I would like to get "good". I know there are a million other ways to achieve this but was curious if there was a way with join.

1 Answers

Sure - just pass an empty string:

var arr2 = arr.join('');
Related