Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function createDictionary(arr) {
- let dictionary = {};
- arr.forEach(str => {
- let obj = JSON.parse(str);
- for (let term in obj) {
- dictionary[term] = obj[term];
- }
- });
- Object.keys(dictionary).sort().forEach(term => {
- console.log(`Term: ${term} => Definition: ${dictionary[term]}`);
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement