Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Initialize dictionary
- var dict = {};
- // create a key-value pair
- dict['hummingbird'] = ["Amethyst woodstar", "Black Inca", "Chilean woodstar", "Crimson topaz"];
- dict['dog'] = ["Golden Retriever", "Great Dane", "Siberian Husky", "Mudhol Hound"];
- dict['panda'] = ["Red pandas", "Giant Pandas"];
- // you can iterate over these keys
- Object.keys(dict).forEach(function(key){
- console.log("key is:", key);
- console.log("value is:", dict[key]);
- });
Add Comment
Please, Sign In to add comment