Implement Your Own "myevery" Method Of Array.

easy
Implement your own "myevery" method of Array.
      You must use prototyping for implementation.
      The every() method tests whether all elements in the array pass the test implemented by the provided 
      function. It returns a Boolean value.

      You can refer the code below for inbuilt "every" method.

	const isBelowThreshold = function(currentValue) {return currentValue < 40};
	
	const array1 = [1, 30, 39, 29, 10, 13];
	
	console.log(array1.every(isBelowThreshold));
	// expected output: true

Input Format

NA

Output Format

NA

Constraints

NA

Notice

Try First, Check Solution later

1. You should first read the question and watch the question video.
2. Think of a solution approach, then try and submit the question on editor tab.
3. We strongly advise you to watch the solution video for prescribed approach.

Example

Input

        
Output

        
Previous
Implement Your Own "mysome" Method Of Array.
Next
Cc_lect14mar2020_q1

Related Questions