Finish the method definition below.
employee_details_at_joining
is a hash that contains details of an employee.
Given employee_details_at_joining
, the method should calculate a new hash updated_employee_details
that contains the same data as employee_details_at_joining
but with the following changes:
- a new key
age
should be added, calculated from year_of_birth
key.
- the
experience
value should incremented by 1 if it exists, otherwise a new key experience
with value 1 should be added to the hash.
Ensure that the key age
is added to the object before experience
in case the experience
key is absent in the initial hash employee_details_at_joining
.