//Map is an Object Literal var map = {}; //Key Needs To be a String var key = ""; // Value can be any String, Number or an Object itself var value; //------- Method I -------------- // Assign a value to a key map[key] = value; // Return value by a key var returnedValue = map[key]; //-------- Method II ---------- // Return value by a key var returnedValue = map.key; // Assign a value to a key map.key = value;
“If you can't explain it to a six year old, you don't understand it yourself.” ― Albert Einstein
Wednesday, June 19, 2013
Implement Java Map in Javascript
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment