7 kyu

JS Prototypes Module #1 - Object Prototypes

1,779dnolan
Description
Loading description...
Fundamentals
  • Please sign in or sign up to leave a comment.
  • ejini战神 Avatar
    • Node 12 should be enabled (Refer this and this for more info)
  • computationlan Avatar

    Sorry, but "you should have enough information to try the Kata" is not even close to being true. Granted, I am new to JS, but level 7 Kata is supposed to be relatively easy to figure out with the information provided and some extra search. This is so not the case here! I've spent at least a few hours reading about prototypes and trying everything I could find. I am nowhere close to solving this. Either it's been mismarked at being level 7, or the description is misleading and confusing. Or you're asking for something that's bad practice and is only a disservice to the beginners. I'm very upset with this Kata. Spent so much time and frustration and haven't learned anything useful so far.

  • chloecoates19 Avatar

    This comment has been hidden.

  • richchurcher Avatar

    I think you should consider removing this one. Solutions which could be considered 'correct' are really bad practice, and if you have to warn against it in the instructions it's probably not a good thing to expose students to. I spent quite a lot of time looking for other solutions becase I thought, "Surely he doesn't mean..."

    • dnolan Avatar

      This comment has been hidden.

    • JohanWiltink Avatar

      .. how they work and when to use them.

      It is also up to ourselves to understand how to use them. You are skipping over that completely. Adding enumerable properties to prototypes, esp. Object ( and Array ), is ++UnGood. And you can test for that.

      Adding properties to Object.prototype just isn't 7 kyu kata material; there's too much subtlety and possile breakage involved.

      My opinion.

  • tormod17 Avatar

    This slightly confused me as "TODO: GIVE ME A DESCRIPTION" statement has a colon after "TODO" which was making me think that the key I was trying to add was "TODO:" with a vlaue of "GIVE ME A DESCRIPTION". After looking at the solutions though I can see the key/field/ feature you are being asked to add to the object is 'description'. I'm wondering if i was the only person who was puzzled by this.

    • dnolan Avatar

      Hey, thanks for the feedback! I've changed Objective description so hopefully nobody else gets tripped up. =)

    • tormod17 Avatar

      to be honest most folk probably would understand your instructions but I'm fairly new to javascript and the ':' had me confused it was useful fo rme though to explore more how to reference an Object. Cheers!

  • h3dkandi Avatar

    So my solution passed and I belive it should have not. I see many others like mine that are marked as correct. It says that the objects themselves shouldn't be changed. But if I try widget.foo it will be undefined. Provide test for such scenarios maybe. Or I've misunderstood what was asked for?

    • dnolan Avatar

      Thank you for the feedback! I agree, this wasn't the intended solution. I initially allowed it because it still managed to complete the objective, but in retrospect I should have just added these tests from the start. I've updated the Kata with the test cases =)

  • dnolan Avatar

    This comment has been hidden.