let say I want to do this:
var dashboard = {}; var page = \"index\"; $(\'.check\').click(function(){ $(thi
I would do it with the ternary operator:
dashboard['pages'][page] = dashboard['pages'][page] ? dashboard['pages'][page] : {};
That will do the trick no matter if it's set/null or whatever.