4. In JavaScript Take an array [49, 50, 51]
Generate a random number between 0 and 100 (exclusive)
If the number if less than first element of the array, add it at the beginning of
the array.
If the number is greater than last element of the array, add it at the end of the
array.
If the number doesn't qualify both conditions, then remove first element if the
number is odd number else remove last element if the number is even
Loop through this process till the number of elements in the array becomes
10.
9:19 AM
Answers
Answered by
0
SUBCRIBE THE CHANEL AND ANSWER पाए
Similar questions