Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

299
Vistas
How do I embed the values of the arguments in JavaScript's Function.prototype.toString?

I need to get a string representation of a function, with its corresponding values of arguments.

Imagine the following statement:

const r1 = (x) => abc(x, 2);

Executing r1.toString() would give a string "x => abc(x, 2)".

Now, imagine I modify the previous piece of code like this:

const create = y => (x => abc(x, y));
const r2 = create(2);

Although r1 and r2 are equivalent in terms of the execution (they will both call abc, passing 2 as the second argument), the string representation will be different. In fact, r2.toString() will now give "x => abc(x, y)".

How do I modify either the create function ro the r2.toString() to have the same output as r1.toString()?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda