var arrayWithObjects = [{time: 82373}, {time: 8234738}];
var arrayWithTime = [];
for (var i = 0; i < arrayWithObjects.length; i++) {arrayWithTime.push(arrayWithObjects[i].time);}
// sort out arrayWithTime
There is better way to do this, but this is the easiest way I found in short amount of time.
Just in case
You don’t need to sort the whole database, you just have to get a first closest entry. Therefore, you need to search through the array and stop on a first match:
const ts = '1234567890'
const getClosestByTS = d => d.find(e => e.timestamp*1 - ts*1 > 0) // or >= 0 if you want to get result with equal ts