1

I am working on a project running on node.js, but I have never worked with JSON before. I included an API, run a function and got a result returned. When I console.log the result I get this:

{ 'Sealed Graffiti | GLHF (Bazooka Pink)': {
    opskins_price: 2,
    market_price: 3,
    opskins_lowest_price: 2
  }
}

How do I work with that result? For example access the opskins_price.

0

1 Answer 1

1
var obj = {
    'Sealed Graffiti | GLHF (Bazooka Pink)': {
        opskins_price: 2,
        market_price: 3,
        opskins_lowest_price: 2
    }
}

console.log(obj['Sealed Graffiti | GLHF (Bazooka Pink)'].opskins_price) // output: 2
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.