javascript, jquery idk -


i got array:

backgrounds:         {         bc2:     '/images/layout/images/backgrounds/bc2.jpg',         codmw2:  '/images/layout/images/backgrounds/codmw2_6.jpg',         bf2:     '/images/layout/images/backgrounds/bf2.jpg',         bf2142:  '/images/layout/images/backgrounds/bf2142.jpg',         codbo:   '/images/layout/images/backgrounds/codbo.jpg',         cod5waw: '/images/layout/images/backgrounds/cod5waw.jpg'        } 

and want access backgrounds[0] = '/images/layout/images/backgrounds/bc2.jpg'. possible or need create array in way?

in case, backgrounds object, i.e., associative array. can't use numerical indexes access members. can iterate through using for( var prop in backgrounds) or can address members directly (backgrounds.bc2 or backgrounds['bc2']).


Comments

Popular posts from this blog

c# - Getting "Internal .Net Framework Data Provider error 30" error when column has NULL value -

c++ - How to modify context menu of internet explorer using IDocHostUIHandler::ShowContextMenu? -

SAP Web Service from .NET via WCF -