Javascript function that takes a single argument. Use that argument value which is a string to return the appropriate value from the matched object key.
function someFunction(someArg) {
var message = {
bob: "Hello bob",
mike: "Hello mike",
tara: "Hello tara"
}
console.log(message + " " + message.someArg + " " + someArg + " " + message.bob);
}
what is returned is
[object Object] undefined bob Hello bob
Where undefined is returned in the console log, JavaScript should return the message "Hello bob" as the value of someArg is "bob", calling message.bob returns the correct result.
return message[someArg];