I need to create a candle value of an object with sorted keys
:
var obj = [{1: 'a'}, {2:'b'}, {3:'c'}, {4:'d'}, {5:'e'},{6: 'a'}, {7:'b'},{8:'c'}, {9:'d'}, {10:'e'}]
What is the most efficient way to filter this object based on the key?
For instance, I want: the obj filtered with 2 < keys <5
or 6 < keys < 9
(in reality, the keys are timestamp and the values are price data)
EDIT: Here is the object. That is what I meant by sorted
var obj = [{1: 'a'}, {2:'b'}, {3:'c'}, {4:'d'}, {5:'e'},{6: 'a'}, {7:'b'},{8:'c'}, {9:'d'}, {10:'e'}]