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

214
Vistas
Get data return from customize face() function in variable in javascript

Actually i want to make a function for my user so that they can fatch any json data with super simplefied way. Thats why this function produce object variable just by calling object. Its searching for object and display its value.

I have made it.

Now i want to get the function return in a variable so that my user do whatever they want.

I am new in JavaScript so i cant figure out with the answer that already exist in this site. Thats why i post my problem. Plz Someone help me here with my code.

My progress is below:

function curl(x,y){let txt; var result; var rx = new RegExp(`["|" ]${y}[ "|" | " |"]:[ "|" | " |"|["](.+?)[}|"]`, 'g');
fetch(x).then(r => r.text()).then(t => {
t.match(rx).forEach(e => { var v = e.replace(rx, '$1');  txt += v + ',' });
var re = decodeURIComponent(JSON.parse('"' + txt.replace(/\"/g, '\\"') + '"'));
result = re.replace(/undefined|"|,\s*$/g,'').replace(/,,/g,'<br>');
alert(result);
});
}
curl('https://list.ly/api/v4/meta?url=http://google.com','images');

Now i want like this:

var data = curl('https://list.ly/api/v4/meta?url=http://google.com','images');
alert(data);
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