I need to reverse an object, and I try this:
promises.push(
post.once('value').then((snapshot2) => Object.assign(snapshot2.val(), { key: snapshot2.key }).reverse()
));
The problem is it gives me this error: Unhandled Rejection (TypeError): Object.assign(...).reverse is not a function
any ideas how to solve? Thanks.