Given a string, you have to return a string in which each character (case-sensitive) is repeated once.
doubleChar("String") ==> "SSttrriinngg"
doubleChar("Hello World") ==> "HHeelllloo WWoorrlldd"
doubleChar("1234!_ ") ==> "11223344!!__ "
function doubleChar(str) {
let ret = '';
for (el in str) ret += str[el] + str[el]
return ret;
}
얼른 map 쓰는게 익숙해지는 날이 오길.......