js-mentorship-razvan / javascript

Javascript study notes
GNU General Public License v3.0
22 stars 2 forks source link

Solve 'Repeating Letters' #318

Closed odv closed 5 years ago

odv commented 5 years ago

https://edabit.com/challenge/Mc6Xi4PRw7fDzeMDB

RazvanBugoi commented 5 years ago
function doubleChar(str) {
    let output = '';
    for (let i=0; i < str.length; i+=1) {
        output += str[i].repeat(2);
    }
    return output;
}