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

99
Views
get JSON data from this structure [JQuery]

I'm trying to get json data from this structure:

"items": {
    "adidas": [
        {
            "name": "STAN SMITH PRIMEGREEN",
            "price": 84.9,
            "image": "https://m/dww/data/products/stan-smith-primegreen.png",
            "availability": [
                {
                    "size": 36,
                    "quantity": 5
                },
                {
                    "size": 37,
                    "quantity": 7
                },
                {
                    "size": 44,
                    "quantity": 9
                }
            ]
        }

I'm able to get this data using the below code is working:

const $showData = $("#show-data");

$.getJSON("data.json", (data) => {
const markup = data.items.adidas.map((item) => `
  
        <!--Product-->
               <img src="${item.image}" alt="shoes image" class="u-max-full-width">
               <h3 class="bold title">${item.name}</h3>
               <h2 class="price">${item.price}</h2>
               <p class="subtitle">${item.brand}</p>
               <p class="desc">${item.description}</p>
  
  `)
  .join("");

const list = $("<p />").html(markup);

$showData.html(list);

But when i tried to get availability array (size and quantity).

data.items.adidas.availability.map and i got this error:

Cannot read properties of undefined (reading 'map')
about 4 years ago · Juan Pablo Isaza
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!