SHARE
TWEET

Make A Dictionary

AreWe Jun 30th, 2020 852 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. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top