This method returns a new array containing all of the elements from the original array once it meets the condition to be equal to true. It will return all of the elements you are looking for as long as it exists in the original array. Below is an example of how the method works with an output that meets my testing condition.
This find() method returns the value of the first element in the provided array that satisfies the provided testing function. Otherwise, an unidentified is returned. In the below example you will see that undentified was returned for every time I declared a variable only because nothing is being invoked. When I console logged the found variable I was able to get my result.
This method returns the index of the first element in the array that satisfies the testing case/conditional. Otherwise, it will return -1 — indicating that no element passed the test.
This method will execute each item in the element and return all the elements from the array.
This method determines whether the array contains a value we are checking for,it will return true or false as appropriate.
This method returns a new array containing the results of the calling function on every element of the original array. *THIS METHOD RETURNS A NEW ARRAY, you may see that this method is similar to the forEach() method but the differnce is that map returns a new array.