Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function parseJSONObjects(arr) {
- let array = new Array();
- for(let string of arr) {
- let object = JSON.parse(string);
- array.push(object);
- }
- for(let object of array) {
- for(let key of Object.keys(object)) {
- console.log(`${key.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();})}: ${object[key]}`)
- }
- }
- }
- //parseJSONObjects(['{"name":"Gosho","age":10,"date":"19/06/2005"}','{"name":"Tosho","age":11,"date":"04/04/2005"}']);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement