Is this really learning?

Tell us what’s happening:
I actually used the hasOwnPorperty line but it didn’t work so I went to the hint page. Copied it out and completed the exercise but I see no relationship between the answer and the explanation of the exercise. The exercise suggested one line needed to be changed but it was numerous lines.
I can keep copying hints but I don’t think I learning anything. How is this educational?

Your code so far


function checkObj(obj, checkProp) {
// Only change code below this line
if(obj.hasOwnProperty(checkProp)){
return obj[checkProp];
} else {
  return "Not Found";
}
// Only change code above this line
}

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36.

Challenge: Testing Objects for Properties

Link to the challenge:

I think that just might be a wording issue. While yes, you are adding multiple lines, you are replacing what in the original code was a single line.

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

You replace return "Change Me!"; which is one line. Hence, “one line” needs to be changed.

instead of going to copy the solution, at this stage you could use the Ask for help button, and try to arrive to the solution on your own, with help

or, you could try again in a few days totally on your own to see if you understood the thing

1 Like

Yes I will wait a while. Is there anywhere I can find more practice exercise. If I had more return and all these other steps to practice, I think it would sink in. I actually had a good run with last 10 or so exercises. I need a bit of repetition. This moves pretty quickly and I get lost.

go back, redo the challenges, if that’s helpful for you

there are various other courses online but they all follow different approaches, they could be helpful or cause more confusion, you need to consider if they can be helpful yourself

sololearn, khan academy, codecademy, various courses on Udemy, Coursera, edX & Co
there is also Just Javascript
video-courses on youtube
books that are freely available online

1 Like

finding obstacles and overcoming them is the only way to learn!

Oh I though teaching was part of it too.

Sololearn looks good, thanks.
bye,

sure, teaching in an awesome way to learn something: being able to explain to someone else is a good sign of having absorbed the topic

You’re right that just copying the solutions from the “Hints” isn’t learning. If you get stuck and look at the hints and come here to ask follow-up questions and discuss the solution then you are learning. This isn’t exactly the same as learning to work through solutions on your own, so it can be a crutch that makes you very good at reading and understanding code but not very good at writing code, so whenever possible I suggest getting help working through the problem instead of getting help understanding the solution.

1 Like