Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to convert string into binary in javascript

// Text to Binary
function text2Binary(string) {
    return string.split('').map(function (char) {
        return char.charCodeAt(0).toString(2);
    }).join(' ');
}
text2Binary("Hello World");
 
PREVIOUS NEXT
Tagged: #convert #string #binary #javascript
ADD COMMENT
Topic
Name
3+8 =