7 kyu
JS Prototypes Module #1 - Object Prototypes
1,779dnolan
Loading description...
Fundamentals
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
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.
This comment has been hidden.
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..."
This comment has been hidden.
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
( andArray
), 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.
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.
Hey, thanks for the feedback! I've changed Objective description so hopefully nobody else gets tripped up. =)
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!
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?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 =)
This comment has been hidden.
Well, there is a correct way to solve this issue... See my solution for an example. ;-)
You're getting ahead of the modules! =P
This comment has been hidden.
This comment has been hidden.