Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2020
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Employee {
  2.     constructor(row) {
  3.         this.name = row.name.toUpperCase();
  4.         this.employeeId = parseInt(row.employee_id)
  5.         this.position = row.position.toUpperCase();
  6.     }
  7. }
  8.  
  9. result = {
  10.     rowCount: 4,
  11.     rows: [
  12.         {name: "John", employee_id: '1', position: "Manager"},
  13.         {name: "Jane", employee_id: '2', position: "Assistant Manager"},
  14.         {name: "Jill", employee_id: '3', position: "Clerk"},
  15.         {name: "Jake", employee_id: '4', position: "Stocker"}
  16.     ]
  17. };
  18.  
  19. employees = result.rows.map((row) => new Employee(row))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement