Dec 29, 2020 05:26 PM
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
mda[i] = 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(sentence[j])) {
fullsetofzeros[i][j]= 1
}
}
}
output.text( Matrix after test ${fullsetofzeros}
)
Dec 30, 2020 07:47 AM
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?
Dec 31, 2020 11:04 AM
This is already being discussed in another thread: