Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
If we put the return statement inside the for loop, the for loop will only run once and therefor will not sum all the positive numbers, the return statement will exit the function immediately once it is encountered, and that's why we should place it outside the for loop so the for loop can run correctly al sum all the positive numbers.
May I ask why the return total is outside of the for loop? I had everything correct but that. Just need somebody to explain ty!!
same with mine) good though
This is great! I like it
Tbh I don't think this is could be best practices... But ok
Well, it wouldn't be in the solution list if it doesn't work. Just, not recommended though. Using global variable like that in production code can lead to various issues.
Would this work? (because i is undefined). Good method tho!
I loved this one because of the comments :)
Who can I sue over this situation?
Assignments define variables globally if you don't use const, let or var. Var is defined only in the innermost function where defined, and let and const are only defined in the block where defined.
i - is not defined...
So, it doesn't work :)
Clean! Deserving of the Best Practices votes
ahhh! i was wondering that!
Thanks for explaining the process in comments. It looks very clear and readable. Good job!
because it will end on the first circle
Loading more items...