Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var crearEmpleado = function(nombre) {
- var multiplicador = 1.25;
- var getNombreImpl = function() {
- return nombre;
- };
- var calcularSueldoImpl = function(sueldo) {
- return multiplicador * sueldo;
- };
- return {
- getNombre : getNombreImpl,
- calcularSueldo : calcularSueldoImpl
- };
- };
- var emp1 = crearEmpleado('Alice');
- alert(emp1.calcularSueldo(1000));
- alert(emp1.getNombre());
- alert(emp1.multiplicador);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement