Ver Mensaje Individual
  #3 (permalink)  
Antiguo 24/02/2017, 15:57
mpozo
 
Fecha de Ingreso: noviembre-2015
Mensajes: 231
Antigüedad: 8 años, 5 meses
Puntos: 86
Respuesta: Consulta class y subclass

Cuando te ocurra eso, haz un log a this
Código Javascript:
Ver original
  1. function Televisor(precioBase, color, consumoEnergetico, peso, resolucion, sintonizador) {
  2.     console.log(this)
  3.     this.resolucion=resolucion || 20;
  4.     this.sintonizador=sintonizador || false;
  5.  
  6.     this.base = Electrodomestico;
  7.     this.base(precioBase, color, consumoEnergetico, peso);
  8.  
  9.         this.precioFinal = this.calcularPrecioFinal(); //ERROR isnot a function
  10.  
  11.     this.calcularPrecioFinal = function() {              
  12.           //CALCULOS
  13.               this.precioFinal += 500;
  14.  
  15.     }
  16.  
  17. }