Get next key-value pair in an object
- by captainclam
So, given a key, I want to find the next property in an object. Then, I want to return the value of the NEXT property. I can not rely on the keys to be ordered or sequential (they're uuids). Please see below for trivial example of what I want:
var db ={
a: 1,
b: 2,
c: 3
}
var next = function(db, key) {
// ???
}
next(db, 'a'); // I want…