How to use the join () function (for tables) without commas

advertisements

This question already has an answer here:

  • array join() method without a separator 1 answer

I was wondering how to use the join function for arrays in JavaScript without it returning commas.

Example:

var alphabet = ['a', 'b', 'c']
alphabet.join();
// returns a,b,c

How do i make it so it doesn't return the commas?


Just specify an empty string for the join:

alphabet.join('');