fork download
  1. function cambio(clave, cant){
  2. d = 18.64;
  3. l = 25.26
  4. e = 21.83
  5. y = 0.13
  6.  
  7. if(clave === 'd') return d * cant
  8. if(clave === 'l') return l * cant
  9. if(clave === 'e') return e * cant
  10. if(clave === 'y') return y * cant
  11. }
  12.  
  13.  
  14. console.log(cambio('e', 24))
  15.  
Success #stdin #stdout 0.03s 18804KB
stdin
Standard input is empty
stdout
523.92