We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d19108b commit 32f1e33Copy full SHA for 32f1e33
Conversions/HexToBinary.js
@@ -21,17 +21,14 @@ const binLookup = (c) => {
21
}
22
const hexToBinary = (hexString) => {
23
/*
24
- Function for convertung Hex to Binary
+ Function for converting Hex to Binary
25
26
1. We convert every hexadecimal bit to 4 binary bits
27
2. Conversion goes by searching in the lookup table
28
29
*/
30
-
31
- let result = ''
32
- hexString = hexString.split('')
33
- hexString.forEach(c => { result += binLookup(c) })
34
- return result
+ const hexLexemes = hexString.split('')
+ return hexLexemes.map(lexeme => binLookup(lexeme)).join('')
35
36
37
export default hexToBinary
0 commit comments