JS converting text to morse code