Question
In JavaScript Question one. 1.Complete removeZS function, so it returns string string without z and s symbols. Remove symbols in uppercase and lowercase. Example: removeZS('Mate
In JavaScript
Question one.
1.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
}
Second question.
2.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
}
Question 3
3.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
SECTION 4
4.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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started