Lesson 8 return, if/else, function


// Define quarter here.
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");

I have the right function I just don't understand its purpose? Why do I need return here and do I dived the number by 4 and then do the modulo thing?


The purpose of a function is to transform input into some output

In your case, your function transforms a number to another number that is a quarter of the input
To do that it needs to divide by 4


oh okay thank you :slight_smile:


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