I want JavaScript to translate text in a textarea into binary code.
For example, if a user types in "TEST
TEST
8-bit characters with leading 0
'sometext' .split('') .map((char) => '00'.concat(char.charCodeAt(0).toString(2)).slice(-8)) .join(' ');
If you need 6 or 7 bit, just change .slice(-8)
.slice(-8)