<<<<<<< HEAD Code Wars - Brett Crafton

Fake Binary

Question

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

Solution by -

My Solution


	function fakeBin(x){
		return String(x.split('').map((x,y) => x < 5? 0: 1).join(''))
		}
				

Try it yourself - CodeWars

======= Code Wars - Brett Crafton

Fake Binary

Question

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

Solution by -

My Solution


	function fakeBin(x){
		return String(x.split('').map((x,y) => x < 5? 0: 1).join(''))
		}
				

Try it yourself - CodeWars

>>>>>>> 0e614172debaa009c8d31330edbeb3b765b59c39