JSchallenger

Accessing object properties two

Viewed: 276
Attempted: 111
Solved: 63
// Write a function that takes an object with two properties as argument
// It should return the value of the property with key 'prop-2'
// Tipp: you might want to use the square brackets property accessor

function myFunction() {

return
}
Test Cases:
myFunction({ one: 1, 'prop-2': 2})
Expected
2
myFunction({ 'prop-2': 'two', prop: 'test'})
Expected
'two'