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

162
Views
React Native - Access to object in array json

I know it's a stupid question, but I've been with this for a while and I can't solve it. I am trying to access this object which is inside an Array. Specifically to url. I Tried this ways:

  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

Doing a console.log of post.yoast_head_json.og_image the following comes out:

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

I have already found the solution to my problem.

Solution:

        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!