You may do these challenges all together in one file, or in separate files, according to your preference. You will turn them in all together.
- Paste this line into your code:
const wordList = ["every", "word", "in", "this", "array", "should", "be", "capitalized"]
- Write a for..of loop that logs each word in the array
- Now, within the loop, capitalize each word
- (this is actually a strings challenge) Try capitalizing only the first letter. There is no string method that does this, so you will need to utilize
.slice() - Rather than simply logging each word in the array, try creating a new array and adding each capitalized word to it
- Add each capitalized word to a string instead of (or in addition to) an array
- Write a loop that will execute exactly 10 times. You can do this with either a while loop or a "classic" for loop
- For each loop, console log whether the number is divisible by 3. (You can do this with modulo)
- you will need a conditional inside your loop for this!
- you can log "true" and "false", or if you prefer, "yes" and "no"
- Solve FizzBuzz without looking up a solution! This is one of the classic beginning programming challenges
- Here is an explanation of the children's math game FizzBuzz
- Write a JS loop that will go 40 times, and for each number console log the number, and either Fizz, Buzz, or FizzBuzz next to it
- Be mindful of the order of your conditions!