I have the following array, which each element contains a information that corresponds to a start value, and end value and an id (i.e. start 5, end 10 and the id being apples).
var fruits = [
[5, 10, apples],
[11, 15, oranges]
];
for (var i = 0; i < fruits.length; i++) {
var lookup = [];
lookup.push({
'START': fruits[i][0],
'END': fruits[i][1],
'VALUE': fruits[i][2]
});
}
At the moment I have a variable that I'd like to compare between a range of values within each object in the array. So If my variable contains the int value 6, I want it to return apples as its within the range of 5 (start) and 10 (end). Can anyone advise my on how I can achieve this?