Skip to content

Instantly share code, notes, and snippets.

@rxlabz
Created October 19, 2015 10:40
Show Gist options
  • Save rxlabz/3573e6790778df5eeb02 to your computer and use it in GitHub Desktop.
Save rxlabz/3573e6790778df5eeb02 to your computer and use it in GitHub Desktop.
// executable sur repl.it
console.log('comment tu t\'appelles ?');
console.read(function(reponseDonnee){
// si : la longueur du texte de la réponse est égale à 0 car.
if(reponseDonnee.length === 0){
console.log( "vous n'avez pas répondu" );
} else if(reponseDonnee.length > 10 || reponseDonnee.length < 1)
{
console.log( "attention 1 caractères min et 10 car. max");
} else {
console.log(
'il y a ' + reponseDonnee.length
+ ' lettres dans ton nom' );
}
console.log('terminé');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment