Question: Add the function getSum that takes an array numbers and returns the sum of all numbers from it. There are only numbers in the array.
Add the function getSum that takes an array numbers and returns the sum of all numbers from it.
There are only numbers in the array.
Examples:
getSum([1, 2, 3]) === 6 getSum([1.2, 2.8, 3]) === 7 getSum([-7, 2, 3]) === -2
: how the function should start: Using the above values to complete the function.
functiongetSum(numbers){
//writecodehere
}
SECOND Section
2.Complete removeZS function, so it returns string string without z and s symbols. Remove symbols in uppercase and lowercase.
Example:
removeZS('Mate academy') === 'Mate academy' removeZS('zzzmatesss') === 'mate' removeZS('ZMzastSe AcaZzzzdemsSy') === 'Mate Academy' removeZS('zszszSSZsz') === ''
: how the function should start: Using the above values to complete the function.
functionremoveZs(string){
//writecodehere
}
THIRD Section
3.Write a function getCapitals, that takes a string string and returns an array of all uppercase letters found in the string keeping the order.
Example: getCapitals('Mate Academy') === ['M', 'A'] getCapitals('MatE AcadEmy') === ['M', 'E', 'A', 'E'] getCapitals('mate academy') === []
: how the function should start: Using the above values to complete the function.
functiongetCapitals(string){
//writecodehere
}
FORTH SECTION
4.Write a doubleChars function that takes a string message and returns a new string with all the message letters doubled.
Example:
doubleChars ('Mate academy') === 'MMaattee aaccaaddeemmyy'
: how the function should start: Using the above values to complete the function.
functiondoubleChars(message){
//writecodehere
}
SECTION 5
You are given an array years that contains years of life of different people in the next format 1714-1748 (year of birth - year of death).
Write a function getAverageAge returning an average life duration of all the people rounding it to the nearest whole (Math.round)
Example:
getAverageAge(['1832-1905', '1876-1956', '1683-1724', '1714-1748']) === 57
getAverageAge([ '1907-1997', '1761-1833', '1535-1582', '1918-2012', '1877-1968', '1696-1724', '1602-1642', '1692-1743', '1695-1762', '1570-1636', '1762-1807', '1668-1731', ]) === 63
: how the function should start: Using the above values to complete the function.
functiongetAverageAge(years){
//writecodehere
}
SECTION 6
Write a function removeVowelKeys, that takes an array of strings keys and returns an array of keys that does not start with a vowel (aeiouy). The letter case does not matter.
Example:
removeVowelKeys(['alarm', 'chip', 'isValid', 'Advice', 'onClick']); // ['chip']
: how the function should start: Using the above values to complete the function.
functionremoveVowelKeys(keys){
//writecodehere
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
