MorseCode is a JavaScript Library to handle the encoding and decoding process of morse code messages.
-
Create an object to handle the encode/decode functions:
m = Object.create(MorseCode);
-
Encoding text into morse code:
- Syntax:
obj.encode('plain text')
orobj.morse('plain text')
m.encode('test message');
m.morse('test message');
- Syntax:
-
Decoding the morse code into plain text:
- Syntax:
obj.decode('morse code')
orobj.morse('morse code', true)
m.decode('.- -... -.-.');
m.morse('.- -... -.-.', true);
- Syntax:
-
Testing the MorseCode Object
MorseCode.test();
-
An object is not required to call functions
MorseCode.encode('some string');
MorseCode.decode('.- -... -.-.');
- Add the audio functionality to encoded messages