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

Double Char

Question

Given a string, you have to return a string in which each character (case-sensitive) is repeated once. Examples (Input -> Output):

* "String" -> "SSttrriinngg" * "Hello World" -> "HHeelllloo WWoorrlldd" * "1234!_ " -> "11223344!!__ "

Solution by -

My Solution


	function doubleChar(str) {
		return str.split('').map((x,i) => x + x).join('')
		}
				

Try it yourself - CodeWars

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

Double Char

Question

Given a string, you have to return a string in which each character (case-sensitive) is repeated once. Examples (Input -> Output):

* "String" -> "SSttrriinngg" * "Hello World" -> "HHeelllloo WWoorrlldd" * "1234!_ " -> "11223344!!__ "

Solution by -

My Solution


	function doubleChar(str) {
		return str.split('').map((x,i) => x + x).join('')
		}
				

Try it yourself - CodeWars

>>>>>>> 0e614172debaa009c8d31330edbeb3b765b59c39