Skip to content
struggling with this 1
Profile icon

Challenge 4:
Write a function called objectSearcher that takes two arguments called myObject which is an object, and property which is a string. When objectSearcher is invoked it will return the value at the property that matches the property string.


const object1 = {firstName: "Phillip", lastName: "Troutman"};
objectSearcher(object1, "firstName") // returns "Phillip"
objectSearcher(object1, "lastName") // returns "Troutman"

You are viewing a single comment. View All
Profile icon

also tried this and got the same result, i know im missing a huge step

const firstName = 'Phillip'
const lastName = 'Troutman'
const objectSearcher = (myObject,property) => {