JSchallenger

Accessing object properties three

Viewed: 306
Attempted: 120
Solved: 65
// Write a function that takes a string and an object with two properties as arguments
// It should return the value of the property with key equal to the value of the string

function myFunction() {

return
}
Test Cases:
myFunction({ continent: 'Asia', country: 'Japan'}, 'continent')
Expected
'Asia'
myFunction({ country: 'Sweden', continent: 'Europe'}, 'country')
Expected
'Sweden'