Skip to main content

Hi there -



When I run this code, I am getting extra commas and the values are not lining up. What am I doing wrong?



let vowels = “aeiou”


let sentence = “Your bumpkin is so beautiful”



let mda=


let fullsetofzeros =


var i


var j



for (i = 0; i < vowel.length; i++) { // p1


mdari] = 0


}



for (i= 0; i < sentence.length; i++) { // p1


fullsetofzeros.push(mda)


}



output.text( Matrix of zeroes ${fullsetofzeros} )



for (i= 0; i < vowel.length; i++) { // p1


for (j= 0; j < sentence.length; j++) { // p1


if (vowel.includes(sentencesj])) {


fullsetofzerosti]zj]= 1


}


}


}



output.text( Matrix after test ${fullsetofzeros} )

Can you provide the output you are getting and your expected output?



You declare a variable vowels with an s at the end and later reference a vowel vowel without an s at the end. Is there additional code you did not include in your post?


This is already being discussed in another thread:




Reply