- Create a replit and write your solutions there. By the end of the winter break or once you finish all the exercises send the link for the replit to your instructors
- To test your functions, you'll need to come up with your examples. Think about different scenarios and input values that will help you verify that your functions work correctly. Feel free to experiment and explore!
- You can also paste your solution in chatGPT and ask it to generate examples for you!
- You will probably need to do some research to understand how to use certain methods but you got it!
-
Find First Even Number:
- Create a function
findFirstEventhat takes an array of numbers and uses thefindmethod to find the first even number in the array.
- Create a function
-
Find Student by Name:
- Create a function
findStudentByNamethat takes an array of objects with student information (name and age) and uses thefindmethod to find the object of the student with a specific name.
- Create a function
-
Find First Undefined Value:
- Create a function
findFirstUndefinedthat takes an array of mixed data types (numbers, strings, and undefined) and uses thefindmethod to find the first undefined value in the array.
- Create a function
-
Find Index of 'A' String:
- Create a function
findIndexOfAthat takes an array of strings and uses thefindmethod to find the index of the first string that starts with the letter 'A'.
- Create a function
-
Find Book by Author:
- Create a function
findBookByAuthorthat takes an array of objects representing books (with title and author) and uses thefindmethod to find the first book written by a specific author.
- Create a function
-
Filter Even Numbers:
- Create a function
filterEvenNumbersthat takes an array of numbers and uses thefiltermethod to create a new array containing only the even numbers.
- Create a function
-
Filter Long Strings:
- Create a function
filterLongStringsthat takes an array of strings and uses thefiltermethod to create a new array containing only the strings with more than five characters.
- Create a function
-
Filter Students Older Than 20:
- Create a function
filterOlderStudentsthat takes an array of objects with student information and uses thefiltermethod to create a new array containing only the students who are older than 20.
- Create a function
-
Filter Numbers Greater Than 10:
- Create a function
filterGreaterThanTenthat takes an array of numbers and uses thefiltermethod to create a new array containing only the numbers greater than 10.
- Create a function
-
Filter Arrays of a Specific Length:
- Create a function
filterArraysByLengththat takes an array of arrays and uses thefiltermethod to create a new array containing only arrays with a specific length.
-
Map Numbers Squared:
- Create a function
mapNumbersSquaredthat takes an array of numbers and uses themapmethod to create a new array where each number is squared.
- Create a function
-
Map Strings Uppercase:
- Create a function
mapStringsUppercasethat takes an array of strings and uses themapmethod to create a new array where each string is converted to uppercase.
- Create a function
-
Map Students Names:
- Create a function
mapStudentsNamesthat takes an array of objects with student information and uses themapmethod to create a new array containing only the names of the students.
- Create a function
-
Map Numbers to Booleans:
- Create a function
mapNumbersToBooleansthat takes an array of numbers and uses themapmethod to create a new array where each number is converted to a boolean (even or odd).
- Create a function
-
Map Array Lengths:
- Create a function
mapArrayLengthsthat takes an array of arrays and uses themapmethod to create a new array containing only the lengths of the nested arrays.
- Create a function
-
ForEach Log Numbers:
- Create a function
forEachLogNumbersthat takes an array of numbers and uses theforEachmethod to log each number to the console.
- Create a function
-
ForEach Log Strings with Exclamation:
- Create a function
forEachLogWithExclamationthat takes an array of strings and uses theforEachmethod to log each string to the console with an exclamation point added.
- Create a function
-
ForEach Log Students:
- Create a function
forEachLogStudentsthat takes an array of objects with student information and uses theforEachmethod to log each student's name and age to the console.
- Create a function
-
ForEach Double Numbers:
- Create a function
forEachDoubleNumbersthat takes an array of numbers and uses theforEachmethod to double each number in the array.
- Create a function
-
ForEach Log Index and String:
- Create a function
forEachLogIndexAndStringthat takes an array of strings and uses theforEachmethod to log each string along with its index in the array.
- Create a function
-
Sort Numbers Ascending:
- Create a function
sortNumbersAscendingthat takes an array of numbers and uses thesortmethod to sort the numbers in ascending order.
- Create a function
-
Sort Strings Alphabetically:
- Create a function
sortStringsAlphabeticallythat takes an array of strings and uses thesortmethod to sort the strings in alphabetical order.
- Create a function
-
Sort Books by Title:
- Create a function
sortBooksBy Titlethat takes an array of objects representing books (with title and author) and uses thesortmethod to sort the books based on their titles in alphabetical order.
- Create a function
-
Reduce Sum of Numbers:
- Create a function
reduceSumOfNumbersthat takes an array of numbers and uses thereducemethod to calculate the sum of all numbers in the array.
- Create a function
-
Reduce Concatenate Strings:
- Create a function
reduceConcatenateStringsthat takes an array of strings and uses thereducemethod to concatenate all strings into a single sentence.
- Create a function
-
Reduce Average Age:
- Create a function
reduceAverageAgethat takes an array of objects with student information (name and age) and uses thereducemethod to calculate the average age of the students.
- Create a function
-
Reduce Product of Numbers:
- Create a function
reduceProductOfNumbersthat takes an array of numbers and uses thereducemethod to calculate the product of all numbers in the array.
- Create a function
-
Reduce Total Array Length:
- Create a function
reduceTotalArrayLengththat takes an array of arrays and uses thereducemethod to calculate the total number of elements in all nested arrays.
- Create a function