JS
challenger
Home
JavaScript Practice
JavaScript objects
Accessing object properties one
Accessing object properties one
Write a function that takes an object with two properties as argument. It should return the value of the property with key country.
reset
function myFunction(obj) {
return
} console.log(myFunction({ continent: 'Asia', country: 'Japan' })) // expected: 'Japan' console.log(myFunction({ country: 'Sweden', continent: 'Europe' })) // expected: 'Sweden'
JavaScript
Run Code
Console