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

152
Views
¿Cómo implementar el código después de la función?

¿Cómo implementar el código después de la función? Debería invocar la función solo después de la tercera vez.

 function after(count, funct) { // code... } var called = function () { console.log("hello"); }; var afterCalled = after(3, called); afterCalled(); // --> nothing is printed afterCalled(); // --> nothing is printed afterCalled(); // --> "hello" is printed

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Puede devolver una función que disminuya el contador y, si es cero, llama a la función entregada.

 function after(count, funct) { return function () { if (!--count) funct(); }; } var called = function () { console.log("hello"); }; var afterCalled = after(3, called); afterCalled(); // --> nothing is printed console.log('.') afterCalled(); // --> nothing is printed console.log('.') afterCalled(); // --> "hello" is printed console.log('.') afterCalled(); // --> nothing is printed

about 4 years ago · Juan Pablo Isaza Report
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!