Skip to content

Instantly share code, notes, and snippets.

@edinsoncs
Created June 22, 2016 02:55
Show Gist options
  • Select an option

  • Save edinsoncs/26cd2528825037f57939146e6a375300 to your computer and use it in GitHub Desktop.

Select an option

Save edinsoncs/26cd2528825037f57939146e6a375300 to your computer and use it in GitHub Desktop.
/**
* @variables
*/
var thisName = prompt('Restaurante: Ingrese su nombre');
var thisCupon = "Aplicando Cupón...";
var thisEatMenu = ['Arroz', 'Pollo', 'Vegetales', 'Salsa'];
/**
* Send a data.
* @variables {thisName and thisCupon} - Return data user entry
*/
var objFn = {
/**
* [saludar function]
* @param {[type]} name [data in variable prompt user]
* @return {[type]} [return name in prompt result]
*/
saludar: function(name){
console.log('Hello welcome sr: ' + thisName);
},
/**
* [almuerzo function]
* @param {[type]} menu [eat menu style the peruvian]
* @param {[type]} segundo [eat one plate]
* @return {[type]} [select item two categories eat´s]
*/
almuerzo: function(menu) {
console.log('You will eat today?');
/**
* [THIS__PRIVATE variable prompt question eat]
* @type {[Write number select eat]}
*/
var THIS__PRIVATE = prompt('Escriba un numero: 0 Arroz - 1 Pollo - 2 Vegetales - 3 Salsa');
switch(Number(THIS__PRIVATE)){
case 0:
console.log('selecionastes arroz')
break;
case 1:
console.log('selecionastes pollo')
break;
case 2:
console.log('selecionastes vegetales')
break;
case 3:
console.log('selecionastes salsa')
break;
default:
console.log('selecionastes otra comida');
}
},
}
objFn.saludar(thisName);
objFn.almuerzo(thisEatMenu)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment