Update the function processUserData
to extract and log specific details from a nested user data
object. Extract the name
and city
fields from the object, renaming them to userName
and userCity
, with default values of Unknown and Unknown City, respectively.
Additionally, retrieve the first friend's name as firstFriendName
and the second friend's age as secondFriendAge
, assigning default values of No Name and 0 if these fields are missing.
Extract the age of the third friend as thirdFriendAge
, also providing a default value of 0.
Finally, log all these extracted values to the console in the specified order. Make sure the function handles missing or null values, using the provided defaults when required.