This assignment serves to reinforce JS syntax, functions, and some mathematical operators and sequences.
After completing this assignment, you should:
Understand general JS syntax
Grasp why functions are important
Understand arrays and loops
Be able to breakdown a simple process of mathematical steps into a series of statements in JS
be able to effectively use the terminal and node to test your JS
Details
- [ ] A gist containing your changes to functions_1.js from our Bananas repository.
- [ ] All functions should be complete and produce the expected output.
- [ ] Complete the problems section II.
- [ ] Complete the problems section III.
Instead of using the browser and the Chrome Dev Tools console to look at your JS output, use node functions_1.js to print the output to your terminal.
Bonus
Write a function in another javascript file (fizzbuzz.js) that prints the numbers from 1 to 100. But for multiples of three print Fizz instead of the number and for the multiples of five print Buzz. For numbers which are multiples of both three and five print FizzBuzz.
Week 3 - Assignment 2
Description
This assignment serves to reinforce JS syntax, functions, and some mathematical operators and sequences.
After completing this assignment, you should:
node
to test your JSDetails
functions_1.js
from our Bananas repository.Instead of using the browser and the Chrome Dev Tools console to look at your JS output, use
node functions_1.js
to print the output to your terminal.Bonus
Write a function in another javascript file (
fizzbuzz.js
) that prints the numbers from 1 to 100. But for multiples of three printFizz
instead of the number and for the multiples of five printBuzz
. For numbers which are multiples of both three and five printFizzBuzz
.Turn this in as a gist as well.
Hint: Research the
%
(modulo) operator.Resources