Advertisement
AreWe

Make A Dictionary

Jun 30th, 2020
1,220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. makeDictionary = (input = []) => {
  2.     const dictionary = input.reduce((dict, val) => Object.assign(dict, JSON.parse(val)), {});
  3.     Object.keys(dictionary).sort().forEach(key => {
  4.         console.log(`Term: ${key} => Definition: ${dictionary[key]}`);
  5.     });
  6. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement