Guest User

Untitled

a guest
Mar 19th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. // Initialize dictionary
  2. var dict = {};
  3.  
  4. // create a key-value pair
  5. dict['hummingbird'] = ["Amethyst woodstar", "Black Inca", "Chilean woodstar", "Crimson topaz"];
  6. dict['dog'] = ["Golden Retriever", "Great Dane", "Siberian Husky", "Mudhol Hound"];
  7. dict['panda'] = ["Red pandas", "Giant Pandas"];
  8.  
  9. // you can iterate over these keys
  10. Object.keys(dict).forEach(function(key){
  11. console.log("key is:", key);
  12. console.log("value is:", dict[key]);
  13. });
Add Comment
Please, Sign In to add comment