Exercice 8 JavaScript


#1

Salut salut,

Quelqu'un pour voler a mon secours s'il vous plait ? Je suis bloquee a l'exercice 8 de JavaScript. Je pense avoir respecte les consignes mais mon code ne marche toujours pas et je ne vois pas ou est mon erreur de syntax :confused: Ci dessous mon code. Merci d'avance a vous :wink:

Hey hey,

someone to help me please ? Im stuck on exercise 8 and i can't move on. I guess I did all i was supposted to but my code doenst work and i don't know where my syntax's error is. I pasted my code below. Thanks for your help and sorry for the broken english :smile:

var quart = function(nombre);

if (quart(24) % 3 === 0) {
return nombre/4;
console.log("La déclaration est vraie");
}
else {
console.log("La déclaration est fausse");
};


#2

semicolon ends a statement.

A function has a header, and then a single statement follows.

A statement can be multiple statements enclosed in {}`s, this is called a compound statement. So when you need to do several things, but you only get to use one statement, you bundle them together in this manner.

You've put a semicolon after your function header, immediately ending its statement.


#3

Thank you so much. I actually forgot the { } in the function and i deleted the semicolon after my if declaration. It works now :smile: