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

334
Views
TypeScript transpilado: ¿Qué hace realmente (0, myFunction)()?

Necesitaba depurar un proyecto de JavaScript que usa Jest para pruebas unitarias, y el seguimiento de la pila me llevó a una línea que decía

 return ( (0, _jestMatcherUtils.matcherHint)( matcherName, undefined, undefined, options ) + '\n\n' + (deepEqualityName !== null ? (0, _jestMatcherUtils.DIM_COLOR)( `If it should pass with deep equality, replace "${matcherName}" with "${deepEqualityName}"` ) + '\n\n' : '' ) + (0, _jestMatcherUtils.printDiffOrStringify)( expected, received, EXPECTED_LABEL, RECEIVED_LABEL, isExpand(this.expand) ) );

Ver esto me hizo preguntarme por qué la expresión (0, myFunc) es una función y por qué TypeScript escribe funciones en este formato particular.

Editar: el código fuente de TypeScript que generó este segmento se puede encontrar aquí

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!