Estoy tratando de resolver un problema de devolución de llamada con js Classes. Necesito si se realiza alguna función para devolver datos.
class MoveSection { constructor(name){ this.name = name; //Some code } nextMove{ //Some Code onLeave:function(args, callback){ console.log(args); if(typeof callback == "function") callback(); } //Somecode } prevMove{ //Some Code onLeave:function(args, callback){ console.log(args); if(typeof callback == "function") callback(); } //Somecode } } const section = new MoveSection("My Name"); section.onLeave(){ console.log("Section moving in:" this.name); }¿Esto no funciona? Cómo crear esta devolución de llamada en 2 funciones OnMove