Last active
October 23, 2015 19:45
-
-
Save rxlabz/1508411d9a7a2936b684 to your computer and use it in GitHub Desktop.
Correction exercice identification Login/Password S2
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
/* | |
* executable dans la console js de http://repl.it | |
*/ | |
var mailAttendu = "toto@gmail.com"; | |
var passwordAttendu = "12345"; | |
console.log("Entrer votre identifiant"); | |
console.read(function(mailSaisi){ | |
if( (Number(mailSaisi.length) > 4) && (mailSaisi.indexOf("@") != -1)){ | |
console.log("Quels est votre mot de passe"); | |
console.read(function(mdp){ | |
if( (mailSaisi == mailAttendu) && (mdp == passwordAttendu) ){ | |
console.log("you're online!"); | |
} else { | |
console.log("identifiants incorrects"); | |
} | |
}); | |
} else { | |
console.log("votre identifiant doit faire au moins 4 caractères et contenir un @") | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment