Which one is correct & Function call


#1

Hello, i dont want to open two topics, so i’ll just ask two questions here.

#1:

why is everything black, when i press RUN? i called the function, but console.log doesnt respond? sry im new in coding

http://shrani.najdi.si/?39/8k/4UY3dJ7W/1/different1.jpg
http://shrani.najdi.si/?1J/JE/1IOLbuUq/1/different2.jpg

It only lets me post one picture per post, so i uploaded them to shrani.si (same as imagehack)

see i want to learn basics first, before i can upgrade myself to PRO and claim my certificate, which is the reason im doing this. But look at those two pictures… Same code, different result? which one has the right answer, and why? Thanks for helping me.:slight_smile:


#2

By default, a function returns None at the end of the function. If we want to return something else at the end of the function, we can use the return keyword.

Given return is the last thing a function does, when a return keyword is reached, the function ends

so the console.log after return is never reached

and you don’t call console.log on your myOutfit function call, so the returned result is also not logged to the console


#3

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