score:0

I'm not sure how the rest of your code looks like, but is there are reason why you couldn't do this?:

d3.json( "./itemlist.json")
    .then(data => {
        return data[0].item[0].table.map(item => item.price);
    })
    .then(prices => {
        let update_price = d3.select('body').selectAll('div').data(prices);
        update_price.enter().append('div').text(d => d);
    });

Or even make it shorter:

d3.json( "./itemlist.json")
    .then(data => {
        let prices = data[0].item[0].table.map(item => item.price);
        let update_price = d3.select('body').selectAll('div').data(prices);
        update_price.enter().append('div').text(d => d);
    });


Related Query

More Query from same tag