How can we display the previous value of given value while the value is given from an array and we should display the previous value of it?
var theArray = [1, 2, 3, 4, 5, 6, 7, 8, 9, 14, 15];
const findValue = (arr, input) => {
// To do
}
findValue(theArray, 15)
When we give 15 in input then the output would be 14.
1? please add your code, you tried.