-
Notifications
You must be signed in to change notification settings - Fork 139
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
Exercice calculatrice #23
Comments
Et si utiliser la correction suivante? |
Plutôt operator ==="+" Ecrire else (operator ==="/") au lieu de else if (operator ="/") à la 9eme ligne Écrire après <<return result;>> calculer(2,3); |
Il manque le "{" au début et à la fin du if, ainsi qu'à la fin de la fonction. Et rajouter, comme tout le monde a dit, l'opérateur == pour vérifier chaque condition.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
J'ai essayé l'exercice calculatrice avec des conditions IF, mais bizarrement le code ne marche pas.
Voici mon code:
function calculer (number1, operator, number2) {
let result;
if (operator = "+")
result = number1 + number2;
else if (operator = "-")
result = number1 - number2;
else if (operator = "*")
result = number1 * number2;
else if (operator = "/")
result = number1 / number2;
return result;
The text was updated successfully, but these errors were encountered: