Skip to content

Instantly share code, notes, and snippets.

@brauliodiez
Created April 25, 2019 10:06
Show Gist options
  • Save brauliodiez/418c9c0e2e6b031026a907d58a1adc37 to your computer and use it in GitHub Desktop.
Save brauliodiez/418c9c0e2e6b031026a907d58a1adc37 to your computer and use it in GitHub Desktop.
class Pedido {
constructor() {
this.descuento = 0.90;
this.venta = 100;
}
aplicaDescuento() {
debugger;
console.log(this.venta);
var self = this;
setTimeout(function() {
debugger;
self.venta = this.venta * this.descuento;
console.log(this.venta);
});
}
}
const pedido = new Pedido();
pedido.aplicaDescuento();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment