HEAD
Given a string of digits, you should replace any digit below 5 with '0' and any digit 5 and above with '1'. Return the resulting string. Note: input will never be an empty string
No examples
function fakeBin(x){
return String(x.split('').map((x,y) => x < 5? 0: 1).join(''))
}
Try it yourself - CodeWars
Given a string of digits, you should replace any digit below 5 with '0' and any digit 5 and above with '1'. Return the resulting string. Note: input will never be an empty string
No examples
function fakeBin(x){
return String(x.split('').map((x,y) => x < 5? 0: 1).join(''))
}
Try it yourself - CodeWars