Cofey
Cofey

Reputation: 11404

How do I get this value in an object?

I need to pull the value out of an object and am not sure how to get to it.

Here's a slimmed down version of my code. Can someone tell me how to get the color?

var object = {
 'fruit' : { 
   apple: { 
    goldenDelicious: [
      { color: 'green' }
    ] 
   } 
  }  
 }

Upvotes: 0

Views: 77

Answers (1)

Daniel A. White
Daniel A. White

Reputation: 190945

object.fruit.apple.goldenDelicious[0].color

Upvotes: 6

Related Questions