Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Employee {
- constructor(row) {
- this.name = row.name.toUpperCase();
- this.employeeId = parseInt(row.employee_id)
- this.position = row.position.toUpperCase();
- }
- }
- result = {
- rowCount: 4,
- rows: [
- {name: "John", employee_id: '1', position: "Manager"},
- {name: "Jane", employee_id: '2', position: "Assistant Manager"},
- {name: "Jill", employee_id: '3', position: "Clerk"},
- {name: "Jake", employee_id: '4', position: "Stocker"}
- ]
- };
- employees = result.rows.map((row) => new Employee(row))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement