Last active
December 20, 2017 08:35
-
-
Save desinas/d4c4f349dc875b62c35e74abdc065550 to your computer and use it in GitHub Desktop.
Factorial ( ! ) Quiz for Udacity FEWD
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Programming Quiz: Factorials (4-7) | |
| */ | |
| var solution= 1; | |
| for (var num= 4; num > 1; num--) { | |
| //console.log(num + " x " + (num-1) + " = "); //verifying correct multilpication | |
| solution = solution * num; | |
| //console.log(solution + " + "); //verifying result | |
| } | |
| console.log(solution); |
What Went Well
- Your code should have a variable solution
- Your code should use a for loop
- Your for loop should correctly calculate the factorial
- Your code should produce the expected output
Feedback: Your answer passed all our tests! Awesome job!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What Went Well
What Went Wrong: Verify that your for loop is producing the correct output ❌⚠️
Feedback: Not everything is correct yet, but you're close!