Advertisement
divanov94

Untitled

Sep 25th, 2020
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function jsonTable(arr){
  2.     let result=[];
  3.     for(let line of arr){
  4.         let person=JSON.parse(line);
  5.         result.push(`\t<tr>\n\t\t<td>${person.name}</td>\n\t\t<td>${person.position}</td>\n\t\t<td>${person.salary}</td>\n\t</tr>`);
  6.  
  7.     }
  8.     console.log(`<table>`);
  9.     console.log(result.join("\n"));
  10.     console.log(`</table>`);
  11.  
  12.  
  13.  
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement