Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chapitre8_exercice1 - Pourquoi ça ne fonctionne pas ? #28

Open
mach1truck opened this issue Dec 26, 2019 · 0 comments
Open

chapitre8_exercice1 - Pourquoi ça ne fonctionne pas ? #28

mach1truck opened this issue Dec 26, 2019 · 0 comments

Comments

@mach1truck
Copy link

Bonjour, je n'arrive pas à comprendre pourquoi mon code ne fonctionne pas. Pouvez-vous m'expliquer ou est mon erreur, svp ?

function compterVoyelles(mot) {
const minuscule = mot.toLowerCase();
let compteur = 0;
for (let i = 0; i < minuscule.lenght; i++) {
if (
minuscule[i] === "a" ||
minuscule[i] === "e" ||
minuscule[i] === "i" ||
minuscule[i] === "o" ||
minuscule[i] === "u"
) {
compteur++;
}
}
return compteur;
}
console.log(compterVoyelles("RadAr"));
console.log(compterVoyelles("Tic et Tac"));
console.log(compterVoyelles("Oasis Oasis Oh"));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant