Incomplete lesson?

Tell us what’s happening:
This lesson appears to be incomplete. I’m not really sure how to advance without changing setup code and using the solutions from 2017.

Your code so far

function checkObj(obj, checkProp) {
// Only change code below this line
return "Change Me!";
// Only change code above this line

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:82.0) Gecko/20100101 Firefox/82.0.

Challenge: Testing Objects for Properties

Link to the challenge:

the difference is that now the function is also passed in the object to check, so that it can be reusable

so, obj is the object to check, checkProp is the property name

the old solution will not work, because that function has only one parameter

But where is the pony, kitten, and sleigh which checkObj is supposed to check for? It won’t let me pass without them.

what’s your whole code?

That was it. The lesson only provides what I’ve shown in the initial post.

and you need to change it and make a function that checks if the passed in object has the passed in property name. As I said, the object is in the obj parameter and the property name in the checkProp parameter. You have everything you need there

There is a possibility I’ve missed something important in a previous challenge. I will go back a few lessons and see what I come up with.

if you want to see example input and output look at the tests, but you just need to change inside the function.

if you see a solution that has an object, it’s for a previous version of the challenge

there is no need for a global object because the function is called with an object as argument: checkObj({name: "Valery", phone: "unknown", job: "marketing"}, "phone") - this function should return true

1 Like

Ah, I feel dumb. I was focusing on the variables, not he function. I think I’ll go back and redo a few challenges anyways, as I shouldn’t be this confused. Thanks for clearing that up for me.