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