Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

168
Views
javascript Classes Callback onLeave

I'm trying to solve a callback problem with js Classes. I need if any function is performed to return data.

    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);
}

This is dont work? How create this callback in 2 function OnMove

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!