Voodlewoodlel (not about codecadamy)


i want to make a little program called Voodlewoodlel. So what i need to do is that i replace every vowel in string with 'oodle'


function changeVowels() {
    var user = prompt('Please enter your string below!');
    var vowels = ['a', 'e', 'i', 'o', 'u'];
    for(i=0;i<user.length;i++) {
        for(j=0;j<vowels.length;j++) {
            if(user[i] === vowels[j]) {
                user[i] = user[i].replace(i, "oodle");


this line:

user[i] = user[i].replace(i, "oodle");

you want to replace from users string, and you want to replace from a specific spot in user string so then you get:

x = user.replace(user[i], "oodle");

and you should store the result in a different variable, otherwise all the vowels in oodle will be replaced as well


@stetim94 Will you please show me how you store result in different variable


i did? i stored the result in a new variable named x?


@stetim94 so how should the code look?


i posted the code:


nevem mind i repaired my code my self and now it works!! :slight_smile:


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.