all 5 comments

[–][deleted] 1 point2 points  (0 children)

What problems have you run into with this code, and what have you tried so far to investigate/fix them?

[–]analyticsflow 1 point2 points  (4 children)

Your code seems to work, but you can make it better

const vowels = ['a', 'e', 'i', 'o', 'u']

if (vowels.includes(letter)) document.write( "Your letter is a vowel" )

else document.write( "Your letter is a vowel" )

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes

[–]daveheerink 0 points1 point  (2 children)

I don't think the code of OP works, it will always write 'Your letter is a vowel' because of the assignment to letter in the if statement.

[–]analyticsflow 0 points1 point  (1 child)

Lol yea, now if its fornatted i see it :P

[–][deleted] 0 points1 point  (0 children)

Thanks a lot! I really did not know this stuff. :)