Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "use strict";
- let jobs = require('./jobs'); // load the jobs module
- let jobList = jobs.readJobs(); // read the jobs.csv file
- console.log("Total # of Jobs " + jobList.length); // how many jobs did we load?
- let managers = getManagerJobs(jobList); // how many manager jobs are there
- console.log("Count of Manager Jobs " + managers.length);
- // TODO 2 - show the count of jobs that are for Manager
- // let myJobs = getCategoryJobs(jobsList , 'Manager');
- // TODO 2 - show the count of jobs that are for Director
- // TODO 2 - show the count of jobs that are for Other
- // TODO 2 - show the count of jobs that are for Vice Pres
- // TODO 4 - how many jobs are there in Dallas
- // TODO 4 - how many jobs are there in Fort Worth
- // TODO 5 - how many jobs are there in Dallas for Vice Pres
- // TODO 5 - how many jobs are there in Fort Worth for Director
- // TODO 7 - what is the average salary for all jobs
- // TODO 7 - what is the average salary for Dallas jobs
- // TODO 7 - what is the average salary for Dallas Director jobs
- // TODO 1 - DO THIS FIRST modify this function to return a list of jobs for any category
- // change the name of the function to not be category specific
- function getManagerJobs( jobs ) {
- let list = []; // empty array to hold jobs that match
- for (let job of jobs) { // look at all jobs in array
- if (job.category === 'Manager') { // is this a manager job?
- list.push(job); // yup, save it
- }
- }
- return list; // send back the jobs found
- }
- // TODO 3 - create function to find jobs in a particular city
- // TODO 6 - Create a function to calculate the average salary from a list of jobs
Add Comment
Please, Sign In to add comment