I have an array that looks like this:
var daysArray = [
{ DayValue: '10D', DayDisplay: '10' },
{ DayValue: '20D', DayDisplay: '20' },
{ DayValue: '30D', DayDisplay: '30' }
]
Now, there is code that does the following.
var selectedDay = getDayDetails('10D')
This code retrieves the value '10D' and checks for its corresponding DayDisplay in the daysArray.
The expected final value of selectedDay is '10'
Similarly, if
var selectedDay = getDayDetails('20D')
, I would expect the final value to be '20'
Could someone please explain how to achieve this?