I am new to javascript. How do I iterate a JSON result that has convert into javascript object?
const url = 'https://api.mybitx.com/api/1/tickers?pair=XBTMYR';
fetch(url)
.then(res => res.json())
//.then(json => console.log(json))
.then(function(data) {
let bp = data.tickers
console.log(bp.timestamp)
})
the object results are
[ { timestamp: 1500349843208,
bid: '9762.00',
ask: '9780.00',
last_trade: '9760.00',
rolling_24_hour_volume: '325.277285',
pair: 'XBTMYR' } ]
I just want to print out the "timestamp" key. Thanks.