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