Skip to content

Instantly share code, notes, and snippets.

@kaylagordon
Last active December 8, 2023 15:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kaylagordon/1cbe5cc0eb8a8dbb1e71917a0dcb181d to your computer and use it in GitHub Desktop.
Save kaylagordon/1cbe5cc0eb8a8dbb1e71917a0dcb181d to your computer and use it in GitHub Desktop.

Tasks

const tasks = [
  {
    taskName: 'write README',
    assignedTo: 'Leta',
    minutesNeeded: 30,
    status: 'inProgress'
  },
  {
    taskName: 'debug issue #14',
    assignedTo: 'Travis',
    minutesNeeded: 120,
    status: 'complete'
  },
  {
    taskName: 'add feature #37',
    assignedTo: null,
    minutesNeeded: 170,
    status: 'inTriage'
  },
  {
    taskName: 'refactor',
    assignedTo: 'Leta',
    minutesNeeded: 80,
    status: 'complete'
  },
];

Level One

Write a function that determines the average time for all tasks

getAverageTime() 
// --> 'The average time for all tasks is 100 minutes.'

Level Two

Write a function that takes in a parameter of a person's name and outputs a list of their assigned tasks

getTasksByPerson('Leta') 
// --> ['write README', 'refactor']

getTasksByPerson('Travis') 
// --> ['debug issue #14']

Level Three

Write a function that shows the total minutes for each status

getStatusTimes() 
// --> 
// {
//   complete: 200
//   inProgress: 30
//   inTriage: 170
// }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment