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

158
Views
React Native: acceso al objeto en la matriz json

Sé que es una pregunta tonta, pero llevo un tiempo con esto y no puedo resolverlo. Estoy tratando de acceder a este objeto que está dentro de un Array. Específicamente a la url. Intenté de esta manera:

  1. post.yoast_head_json.og_image.url
  2. post.yoast_head_json.og_image[0].url
  3. post.yoast_head_json.og_image['url']
  4. post.yoast_head_json.og_image.[0].url

Haciendo un console.log de post.yoast_head_json.og_image sale lo siguiente:

 Array [ Object { "height": 427, "type": "image/jpeg", "url": "https://www.example.es/wp-content/uploads/2022/01/pexels-picjumbocom-196656.jpg", "width": 640, }, ]
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Ya he encontrado la solución a mi problema.

Solución:

 let data; const imageUrl = []; posts.forEach ( (post)=> { if(post.yoast_head_json.og_image != undefined) { data = JSON.stringify(post.yoast_head_json.og_image); JSON.parse(data, (key, value) => { let valueStr = String(value); if (valueStr.includes('https')) { imageUrl.push(valueStr); } }) } });
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!