Functions, return and if / else


#1

// Define quarter here.

var quater = function(number)
{
return number/4;
}

if (quarter(12) % 3 === 0 ); {
console.log("The statement is true");
}

else {
console.log("The statement is false");
}
Can you guys please tell me what is wrong with my code

Here is the link to the lesson


#2

https://www.codecademy.com/courses/javascript-beginner-en-6LzGd/1/3?curriculum_id=506324b3a7dffd00020bf661


#3

if (quarter(12) % 3 === 0 ); // remove ;

#4

@rcodeman Still getting an error


#5

Format your code correctly please.


#6

@tagace42179 You misspelled quarter here:

You need to change that.

Hope your code works now

Steven


#7

quater  not quarter(12)  // have a close look

#8

Thanks Did not notice that


#9

Is it working now? Because I cannot find anymore errors


#10

var quarter = function(number)
{
return number/4;
};

if (quarter(12) % 3 === 0 ) {
console.log("The statement is true");
}

else {
console.log("The statement is false");
}


#11

Yep I am Good Now code works


#12

you forgot ; after the {


#13

@anarccw you do not really need that. I mean if you where running a program with that you won't really need that, but it does make the code look better :wink:


#14

OK.
@steven.copeland


#15

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.