I'm a little confused about the difference between console.log and return, 1/14


#1

In 1/14, the text says: " Make sure to return - don't use console.log( )!" What is the difference?


#2

and this's also wrong. gotta know what's wrong.

var isEven = function(number) {
// Your code goes here!

if (isEven === true) {
return "firstsomething"
}
else {
return "secondsomething"
}
return false
};


#3

and this is also wrong as this:

if (isEven === true) {

doesn't make sense. isEven is a function not a boolean so it will never be true also anything but the isNaN case should return a boolean instead of a string.


#4

The difference betwenn console.log and return is that console.log is a output function that prints stuff to the console and return is a way to end a function and pass a value to the caller. It is not an output to the console and should not be confused with one. But you might see a returned statement on the console because of a console feature that echos the last used value. But again this has nothing to do with return and would work for any value except undefined.


#5

Thanks a lot, that started to confuse me. :grinning: