DissDoc Blog
ИТ-индустрия
Wednesday, March 24, 2010
JavaScript: array like hash
Good (assuming Object has not been overloaded or extended)
var
array
=
new
Object()
;
array[
'something'
] =
‘yay’
;
array[
'somethingelse'
] =
‘more’
;
for
( keyVar
in
array ) { alert(array[keyVar]); }
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment