Advertisement
Militsa

14. Parse JSON Objects 2

Dec 25th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function parseJSONObjects(arr) {
  2.     let array = [];
  3.     for(line of arr) {
  4.         array.push(JSON.parse(line));
  5.     }
  6.  
  7.     for(human of array) {
  8.         console.log(`Name: ${human.name}`);
  9.         console.log(`Age: ${human.age}`);
  10.         console.log(`Date: ${human.date}`);
  11.     }
  12. }
  13.  
  14. //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