0

I'm new to JS, and am curious on how to return a value of the key name in the property name: "Eric". Here is the problem: We are going to complete a function that takes in an object and a string (will refer to a key in the object). The function should return the value of the property located within the object at the given string key. And here is my code:

function returnAValue(obj, key) {
  name: "Eric"
return name
}

I've been stuck on this for a while, and from what I understand it's asking me to put a string ("Eric") into the function returnAValue and the have it with a key ("name"). Then, return the value ("Eric") of the property ("name: "Eric"").

Thanks!

Eric
  • 1
  • 1

0 Answers0