7 kyu

Find an employees role in the company

1,467 of 2,947incidental

Description:

You get a new job working for Eggman Movers. Your first task is to write a method that will allow the admin staff to enter a person’s name and return what that person's role is in the company.

You will be given an array of object literals holding the current employees of the company. You code must find the employee with the matching firstName and lastName and then return the role for that employee or if no employee is not found it should return "Does not work here!"

The array is preloaded and can be referenced using the variable employees ($employees in Ruby). It uses the following structure.

let employees = [ {firstName: "Dipper", lastName: "Pines", role: "Boss"}, ...... ]
employees = [ {'first_name': "Dipper", 'last_name': "Pines", 'role': "Boss"}, ...... ]
employees = [ {'first_name'=> "Dipper", 'last_name'=> "Pines", 'role'=> "Boss"}, ...... ]

There are no duplicate names in the array and the name passed in will be a single string with a space between the first and last name i.e. Jane Doe or just a name.

Fundamentals
Arrays

More By Author:

Check out these other kata created by incidental

Stats:

CreatedAug 11, 2015
PublishedAug 11, 2015
Warriors Trained5807
Total Skips768
Total Code Submissions14433
Total Times Completed2947
JavaScript Completions1467
Ruby Completions400
Python Completions1155
Total Stars58
% of votes with a positive feedback rating91% of 386
Total "Very Satisfied" Votes327
Total "Somewhat Satisfied" Votes50
Total "Not Satisfied" Votes9
Ad
Contributors
  • incidental Avatar
  • ooflorent Avatar
  • GiacomoSorbi Avatar
  • NaMe613 Avatar
  • Blind4Basics Avatar
  • Voile Avatar
  • Just4FunCoder Avatar
  • saudiGuy Avatar
Ad