javascript – Firebase no guarda of dento de una función js

firebase.initializeApp ({
apiKey: "Exists",
authDomain: "Exists",
projectId: "Exist"
});

var db = firebase.firestore ();

guardar function (oldPassword, newPassword) {
db.collection ("users"). add ({
correo: "email",
password: "oldPassword"
})
.then (function (docRef) {
console.log ("Document written with ID:", docRef.id);
})
.catch (function (error) {
console.error ("Error while adding document:", error);
});

}

arrVariables = location.search.substring (1, location.search.length);
arrVariableActual = arrVariables.split ("=");
var arrEmail = arrVariableActual[1].split ("% 40");
var email = arrEmail[0] + "@" + arrEmail[1];
document.getElementById ("corr"). innerHTML = email;

leerPasswords () function

var oldPassword = document.getElementById ("contraActual"). value;
var newPassword = document.getElementById ("contraNueva"). value;
//action="recoverySuccess.html "

guardar (oldPassword, newPassword)



}