letnums=[1,2,3,4,5];letnumsSquared=[];// Use .map() to get the square of nums and store the value in numsSquared// numsSquared => [1, 4, 9, 16, 25]
isDivisibleBy3
letnums=[1,2,3,4,5,6,7,8,9];letisDivisibleBy3=[];// Use .filter() to find out the numbers that are divisible by 3 and store the value in isDivisibleBy3// isDivisibleBy3 => [3, 6, 9]
Abbreviations
constdays=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];letdayAbbreviations=[];// Find the abbreviation of all days and add them to dayAbbreviations array// dayAbbreviations => ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
Capitalize
constiAS=['ahmed','sami','moath','ghadeer'];letcapitalizedIAs=[];// Capitalize all the strings in the IA's array and store them in the array capitalizedIA.// capitalizedIAs => ["AHMED", "SAMI", "MOATH", "GHADEER"]
Crazy numbers, again!
// These crazy numbers are now strings ๐ฏ ๐ฏ !! conststringNumbers=["103440","3799.2663","3.14159265359","859494","59439"];lettotalNumbersUnder4000=0;// Convert numbers from strings to numbers and sum all numbers under 4000 and store them in totalNumbersUnder4000// totalNumbersUnder4000 => 3802.4078926536