I am applying between condition in filtering of array based on another array. The example below works if array length is 1. If I have more than one, let's say var expText = ['1-3', '6-9']. In that case I want (Value >= lowerValue1 && Value < upperValue1) || (Value >= lowerValue2 && Value < upperValue2)
var Annual = [{"Date":1998,"Value":6.5},{"Date":1999,"Value":4},{"Date":2000,"Value":1},{"Date":2001,"Value":3}]
var expText = ['1-3']
expText2 = expText[0].match(/\d+/g);
lowerValue = parseInt(expText2[0]);
upperValue = parseInt(expText2[1]);
result = Annual.filter(function(v) { return (v.Value >= lowerValue && v.Value < upperValue) })
console.log(result);