Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

215
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda