Accessing Object Properties

by mmansion

HTML

<div id="output"></div>

JavaScript

var food = {
    
    fruits: {
     
        citrus: "orange"
        
    }
    
}

//access the "orange" using dot-syntax notation of the object

$('#output').text( food.fruits.citrus );