Get key after push in Firebase

To get the key after pushing an object in Firebase:

javascript
let ref = firebase.database().ref('/someReference');
let key = ref.push().key;

Hi, I'm Erik, an engineer from Barcelona. If you like the post or have any comments, say hi.