Skip to content

Conversation

@ASPhillips8
Copy link

Create function to create employee record. Create function to create an array of employee Records. Use this to and created functions for time in and time out events. Use this in creating function for getting hours worked. Create function using this an using helper function to calculate wages earned for a particular date. Create function using find to search an array for matching first name. Create function to calculate payroll that uses helper function allWagesFor which was given in the lab.

Copy link

@stephenmckeon stephenmckeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use const unless you HAVE to use let

Comment on lines +13 to +14
let employeeList = employees.map((employee) => createEmployeeRecord(employee))
return employeeList

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let employeeList = employees.map((employee) => createEmployeeRecord(employee))
return employeeList
return employees.map((employee) => createEmployeeRecord(employee))

Comment on lines +81 to +83
let payRoll = employeeRecords.reduce((total, employeeRecord) => total + allWagesFor.call(employeeRecord), 0)

return payRoll

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let payRoll = employeeRecords.reduce((total, employeeRecord) => total + allWagesFor.call(employeeRecord), 0)
return payRoll
return employeeRecords.reduce((total, employeeRecord) => total + allWagesFor.call(employeeRecord), 0)

Comment on lines +76 to +77

return srcArray.find((employeeRecord) => employeeRecord.firstName = firstNameString)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return srcArray.find((employeeRecord) => employeeRecord.firstName = firstNameString)
return srcArray.find((employeeRecord) => employeeRecord.firstName = firstNameString)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants