- Given the array
numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
, iterate over the array and add all numbers together.
- Given the array
numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
, iterate over the array and multiply all the integers by themselves, and sum them together.
- Given the array
numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
, filter out all odd numbers.
- Given the array
words = ["cat", "hat", "rat", "pie", "luck", "mustard", "car", "plane", "wings", "i", "my", "no"];
, iterate through the array and keep all words with three or fewer letters.
- Given the string
paragraph = "I am going to make an apple pie for the picnic this weekend. Hopefully no one is allergic to apples!"
, split the string on spaces so you get an array where each word of the paragraph is an element. Then, iterate through the array and keep all words with an even number of letters. - Do the same thing keepign all uneven words.