Javascript remove square brackets from a string.