Objects inside objects in javascript

The Solution to Objects inside objects in javascript is


var pause_menu = {
    pause_button : { someProperty : "prop1", someOther : "prop2" },
    resume_button : { resumeProp : "prop", resumeProp2 : false },
    quit_button : false
};

then:

pause_menu.pause_button.someProperty //evaluates to "prop1"

etc etc.

~ Answered on 2011-06-21 18:18:46


Most Viewed Questions: