Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e2ef912

Browse files
Merge pull request #7 from amolmt/master
Convert string to binary in Vanilla JS
2 parents 653b583 + bcc5a0e commit e2ef912

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

‎ConvertStringToBinary/index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
@author amolmt
3+
*/
4+
5+
function StringToBinary(string) {
6+
return string
7+
.split("")
8+
.map(function(char) {
9+
return char.charCodeAt(0).toString(2);
10+
})
11+
.join(" ");
12+
}
13+
14+
console.log(StringToBinary("Test"));

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /