lybak
December 15, 2017, 6:04pm
#1
I’m current on the Functions module of JavaScript where my current task is:
Refactor the function declaration to be a function expression using arrow function syntax.
Be sure to call the function at the end.
I refactored it, but my code seems to be off. Can someone help me?
const isGreaterThan (numberOne, numberTwo) => {
if (numberOne > numberTwo) {
return true;
} else {
return false;
}
};
isGreaterThan(5, 7);
isGreaterThan(2, 8);
mtf
December 15, 2017, 6:27pm
#2
This should be giving an error since there is no assignment.
const foo = () => {
};
Tip for future reference (not to undo the purpose of this lesson):
numberOne > numberTwo
is a boolean, so we can return it directly.
return numberOne > numberTwo;
1 Like
can you post the link please
mtf
December 16, 2017, 12:47am
#4
The OP will have solved their problem by now, being a missing =
operator. Probably not much need for the link now. If you have a question about this lesson, then please start a new topic.
1 Like
system
closed
December 23, 2017, 12:48am
#5
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.