开发者

How do I get this value in an object?

开发者 https://www.devze.com 2023-01-25 04:08 出处:网络
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?

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' :开发者_如何学Go { 
   apple: { 
    goldenDelicious: [
      { color: 'green' }
    ] 
   } 
  }  
 }


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

精彩评论

暂无评论...
验证码 换一张
取 消