Javascript define objects with sub objects in single line Posted byMenolOctober 21, 2013Posted inWeb DevelopmentTags:Javascript, javascript inline objects, javascript object definition var tmp = {sub:{title:’titlex’, alt:’altx’}, viewName:’xxx’}; “sub” is the sub object that has properties, title and alt. ViewName is a property of the parent class. Share this:TwitterFacebookLike this:Like Loading... Related