Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2
if( n == 1 ) { In here n will always be 1, therefore return n and return 1 are the same thing. }
22nd Dec 2019, 10:03 AM
Dennis
Dennis - avatar
+ 1
The return will only done, if n == 1 So it's the same. In this case "n" is always equal 1. You can return "n" or "1". It makes no difference.
22nd Dec 2019, 10:08 AM
Coding Cat
Coding Cat - avatar