The following code sorts by the numerical value of timestamps. It ignores skips over array entries and performs string-to-number conversion of timestamps, if necessary. It assumes that besides 'string' and 'number', timstamps are of no other data type.
userArray.filter ( px_item => {
    return (px_item !== undefined);
})
.map ( px_item => {
    if (typeof px_item === "string") {
        return parseInt(px_item);
    } else {
        return px_item;
    }
})
.sort(function(a, b) {
    if (typeof a === "undefined") {
        return -1;
    } else {
        if (typeof b === "undefined") {
            return 1;
        } else {
            return Math.sign ( a['timestamp'] - b['timestamp'] );
        }
    }
});
The original code had the sort function wrong. This function is actually a comparison function to determine the relative order of two elements (which in the given use case would be array entries). The order is expressed as one of the numerical values -1 (a < b), 0 (a = b), and 1 ( a > b ) (in fact, for the result of the comparison to be processed correctly, it suffices that the result has the proper sign, so Math.sign could be eliminated).
     
    
userArray[childDatamsg.timestamp]? Your array has a length of 1.5 billion now. UseuserArray.push(userValue)