• How it Works
    
    /**
     *
     * @param {*} string
     */
    function StringToMorse(str) {
      let output = "";
      [...str].forEach(c => {
        output = output + " " + (MORSE_MAP[c.toUpperCase()] || "");
      });
      return output;
    }
    // this list of international morse codes
    const MORSE_MAP = {A: ".-",B: "-...",C: "-.-.",D: "-..",E: ".",F: "..-.",G: "--.",H: "....",I: "..",J: ".---",K: "-.-",L: ".-..",M: "--",N: "-.",O: "---",P: ".--.",Q: "--.-",R: ".-.",S: "...",T: "-",U: "..-",V: "...-",W: ".--",X: "-..-",Y: "-.--",Z: "--..",1: ".----",2: "..---",3: "...--",4: "....-",5: ".....",6: "-....",7: "--...",8: "---..",9: "----.",0: "-----",".": ".-.-.-",",": "--..--",":": "---...","?": "..--..","'": ".----.","-": "-....-","/": "-..-.","(": "-.--.",")": "-.--.-",'"': ".-..-.","@": ".--.-.","=": "-...-","&": ".-...","+": ".-.-.","!": "-.-.--"};
    
  • International Morse code
    • 0-----
    • 1.----
    • 2..---
    • 3...--
    • 4....-
    • 5.....
    • 6-....
    • 7--...
    • 8---..
    • 9----.
    • A.-
    • B-...
    • C-.-.
    • D-..
    • E.
    • F..-.
    • G--.
    International Morse code
    • H....
    • I..
    • J.---
    • K-.-
    • L.-..
    • M--
    • N-.
    • O---
    • P.--.
    • Q--.-
    • R.-.
    • S...
    • T-
    • U..-
    • V...-
    • W.--
    • X-..-
    International Morse code
    • Y-.--
    • Z--..
    • ..-.-.-
    • ,--..--
    • :---...
    • ?..--..
    • '.----.
    • --....-
    • /-..-.
    • (-.--.
    • )-.--.-
    • ".-..-.
    • @.--.-.
    • =-...-
    • &.-...
    • +.-.-.
    • !-.-.--
  • About Morse Code

    Morse code is a character encoding scheme used in telecommunication that encodes text characters as standardized sequences of two different signal durations called dots and dashes or dits and dahs.[2][3] Morse code is named for Samuel F. B. Morse, an inventor of the telegraph.

    The International Morse Code encodes the 26 English letters A through Z, some non-English letters, the Arabic numerals and a small set of punctuation and procedural signals (prosigns). There is no distinction between upper and lower case letters. Each Morse code symbol is formed by a sequence of dots and dashes. The dot duration is the basic unit of time measurement in Morse code transmission. The duration of a dash is three times the duration of a dot. Each dot or dash within a character is followed by period of signal absence, called a space, equal to the dot duration. The letters of a word are separated by a space of duration equal to three dots, and the words are separated by a space equal to seven dots. To increase the efficiency of encoding, Morse code was designed so that the length of each symbol is approximately inverse to the frequency of occurrence in text of the English language character that it represents. Thus the most common letter in English, the letter "E", has the shortest code: a single dot. Because the Morse code elements are specified by proportion rather than specific time durations, the code is usually transmitted at the highest rate that the receiver is capable of decoding. The Morse code transmission rate (speed) is specified in groups per minute, commonly referred to as words per minute.

    Morse code can be memorized, and Morse code signalling in a form perceptible to the human senses, such as sound waves or visible light, can be directly interpreted by persons trained in the skill.
    Morse code Wiki
    More info