Double Char

PHOTO EMBED

Tue Oct 04 2022 09:44:17 GMT+0000 (Coordinated Universal Time)

Saved by @j_jivan #javascript

/*Given a string, you have to return a string in which each character (case-sensitive) is repeated once.*/

function doubleChar(str) {
  let newStr = "";
  for(let i = 0; i < str.length; ++i){
    newStr+= str[i] + str[i];
  }
  return newStr;
}
content_copyCOPY

https://www.codewars.com/kata/56b1f01c247c01db92000076/train/javascript