-
-
Save Spirecool/71301bf48108d7c80ca23cb58e055ba5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Formulaire de connexion : CALLBACK | |
function connection(username,password,email){ | |
if(username.length !== 0) { | |
console.log("username OK !"); | |
} if(password.length <= 6){ | |
console.log("Le mot de passe est trop court"); | |
} if(!email.includes("@")) { | |
console.log("Votre email n'est pas valide"); | |
} | |
// save(err, userSave) => { //dans "save" on va faire une callback pour enregistrer les infos | |
// //Si jamais il y a une erreur, cela va nous dire qu'il y a une erreur. FOnction de retour qui permet de vérifier que tout se passe bien. | |
// if(err) return console.log(err) | |
// return userSave | |
// }) | |
} | |
connection('Billy', 'password', '[email protected]'); // renvoie username OK ! (donc tout est bon) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment